I have built a plugin and can use it to generate Carbon applications. I use the plugin creater GUI to create the plugin and place the dylib file in both the Carbon and Cocoa folders. The problem I have is that Realstudio gives the error "Compilation of APM_Float.rbp failed. Plugin "apm.rbx:0 is not supported for Mac Cocoa." when I try to build a Cocoa application with it. I am using a Mac running Lion OS, RS2011 r4 and Xcode 4. The plugin is only wrapping math type functions (i.e. not making controls and such). See code excerpt below:
#include "rb_plugin.h"
// // declarations and functions here //
REALmethodDefinition apm_to_formatted_string_c_def={ (REALproc) apm_to_formatted_string_c, REALnoImplementation, "apm_to_formatted_string_c(line_termination as int8, line_length as integer, byref string_length as int64, sign as integer, exponent as int64, digit_count as int64, input as ptr, output as ptr)"};
REALmethodDefinition apm_digits_to_string_c_def={ (REALproc) apm_digits_to_string_c, REALnoImplementation, "apm_digits_to_string_c(digit_count as int64, out_position as int64, input as ptr, output as ptr)"};
REALmethodDefinition apm_normalize_c_def={ (REALproc) apm_normalize_c, REALnoImplementation, "apm_normalize_c(byref digits as int64, byref exponent as int64, r as ptr)"};
REALmethodDefinition apm_fft_c_def={ (REALproc) apm_fft_c, REALnoImplementation, "apm_fft_c(power_of_two as int64, adigits as int64, a as ptr, ain as ptr, bdigits as int64, b as ptr, bin as ptr, r as ptr)"};
REALmethodDefinition apm_subtract_c_def={ (REALproc) apm_subtract_c, REALnoImplementation, "apm_subtract_c(last_digit as int64, x as ptr, y as ptr, r as ptr)"};
REALmethodDefinition apm_add_c_def={ (REALproc) apm_add_c, REALnoImplementation, "apm_add_c(byref last_digit as int64, x as ptr, y as ptr, r as ptr) as integer"};
void PluginEntry() { REALRegisterMethod(&apm_to_formatted_string_c_def); REALRegisterMethod(&apm_digits_to_string_c_def); REALRegisterMethod(&apm_normalize_c_def); REALRegisterMethod(&apm_fft_c_def); REALRegisterMethod(&apm_subtract_c_def); REALRegisterMethod(&apm_add_c_def); }
I experimented to see if I could use the plugin as is with declares and build a Cocoa app. I can after preceding functions with " extern "C" ". But I have had no luck using the plugin as a plugin with Cocoa. I did notice that using declares appeared to be much slower than accessing the functions using the plugin. Any suggestions on how I can modify the plugin or development environment to work for cocoa would be most appreciated.
Thanks,
|