Ah shoot! I found the Init function at the end of the objc_test.m file...
Ok it works now :)
Cheers,
Eloy
On 8/8/07, Eloy Duran <elo...@gm...> wrote:
> Hello,
>
> I was wondering what I need to do in order to compile and use a
> objective-c class, like objc_test.m in the test suite of rubycocoa.
>
> This is my test class:
>
> #import <Foundation/Foundation.h>
>
> @interface BaconClass : NSObject
> {
> }
> @end
>
> @implementation BaconClass
> - (BOOL)isChunky { return YES; }
> @end
>
> I compile it like this:
>
> cc -o Test.bundle -fno-common -g -fobjc-exceptions -arch ppc -arch
> i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -DMACOSX
> -I/usr/include/libxml2 -DHAS_LIBXML2
> -I../src/rubycocoa-latest2/misc/libffi/include -framework Foundation
> -bundle BaconClass.m
>
> This gives me a compiled bundle which I then try to use like this:
>
> >> require 'osx/cocoa'
> => true
> >> require 'Test.bundle'
> LoadError: Failed to lookup Init function ./Test.bundle
> from ./Test.bundle
> from /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in
> `require'
> from (irb):2
>
> But as you can see ruby fails to find the Init function....
> So what extra do I need to tell ruby to be able to use it?
>
> Cheers,
> Eloy
>
|