Ruby c++ extension on intel mac


#1

Hey,

I am having trouble building an extension on a new intel mac. The
extension I have at the moment is simple, basically the example out of
the big ruby book.

The error I get when building is

macbook:~/projects/extension_shared_ptr_test reevesg$ make
cc -bundle -L"/usr/lib" -o Extension.bundle extension.o -lruby
-lpthread -ldl -lobjc
/usr/bin/ld: Undefined symbols:
___gxx_personality_v0
collect2: ld returned 1 exit status
make: *** [Extension.bundle] Error 1
macbook:~/projects/extension_shared_ptr_test reevesg$

I think i may need to build my ruby from scratch because this sounds
like a gcc incompatibility to me.

Here is my gcc output

macbook:~/projects/extension_shared_ptr_test reevesg$ gcc -v
Using built-in specs.
Target: i686-apple-darwin8
Configured with: /private/var/tmp/gcc/gcc-5250.obj~20/src/configure
–disable-checking -enable-werror --prefix=/usr --mandir=/share/man
–enable-languages=c,objc,c++,obj-c++
–program-transform-name=/^[cg][^.-]*$/s/$/-4.0/
–with-gxx-include-dir=/include/c++/4.0.0 --build=powerpc-apple-darwin8
–with-arch=pentium-m --with-tune=prescott --program-prefix=
–host=i686-apple-darwin8 --target=i686-apple-darwin8
Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5250)
macbook:~/projects/extension_shared_ptr_test reevesg$

Anyone got any ideas on how to proceed? Is there a ruby extensions list
or IIRC channel somewhere. I could definitely use the help.

Thanks

Gareth


#2

On Thu, Mar 09, 2006 at 05:04:33AM +0900, Gareth R. wrote:

-lpthread -ldl -lobjc

Thread model: posix
gcc version 4.0.1 (Apple Computer, Inc. build 5250)
macbook:~/projects/extension_shared_ptr_test reevesg$

Anyone got any ideas on how to proceed? Is there a ruby extensions list
or IIRC channel somewhere. I could definitely use the help.

On my iBook, ___gxx_personality_v0 is in libstdc++.dylib. Maybe you
need to add an explicit -lstdc++ to compile it.

Steve P.
removed_email_address@domain.invalid


#3

On Thu, 9 Mar 2006, Steve P. wrote:

cc -bundle -L"/usr/lib" -o Extension.bundle extension.o -lruby
-lpthread -ldl -lobjc
/usr/bin/ld: Undefined symbols:
___gxx_personality_v0
collect2: ld returned 1 exit status
make: *** [Extension.bundle] Error 1
macbook:~/projects/extension_shared_ptr_test reevesg$

I think i may need to build my ruby from scratch because this sounds
like a gcc incompatibility to me.

try

CC=g++ make

-a