Hello, I'm working with R, I try to call C from R. When I try to compile my file.c to make file.so, with the command : R CMD SHLIB foo.c return the message : gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -std=gnu99 -dynamiclib -Wl,-headerpad_max_install_names -Wl,-macosx_version_min -Wl,10.4 -undefined dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o foo.so foo.o -F/Library/Frameworks/R.framework/.. -framework R /usr/bin/libtool: for architecture cputype (16777223) cpusubtype (3) object: /usr/local/lib/libgcc_s.10.4.dylib malformed object (unknown load command 4) make: *** [foo.so] Error 1 Can you help me ? I work on Mac os X. Thanks -- Anais K [[alternative HTML version deleted]]
Hi Anais,>>>>> "ak" == anais khuong <anais.khuong at gmail.com> >>>>> on Wed, 12 Mar 2008 18:00:08 +0100 (CET) writes:ak> Hello, ak> I'm working with R, I try to call C from R. ak> When I try to compile my file.c to make file.so, with the command : ak> R CMD SHLIB foo.c ak> return the message : ak> gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk ak> -mmacosx-version-min=10.4 -std=gnu99 -dynamiclib ak> -Wl,-headerpad_max_install_names -Wl,-macosx_version_min -Wl,10.4 -undefined ak> dynamic_lookup -single_module -multiply_defined suppress -L/usr/local/lib -o ak> foo.so foo.o -F/Library/Frameworks/R.framework/.. -framework R ak> /usr/bin/libtool: for architecture cputype (16777223) cpusubtype (3) object: ak> /usr/local/lib/libgcc_s.10.4.dylib malformed object (unknown load command 4) ak> make: *** [foo.so] Error 1 this shows that your [R <-> Mac OS X] setup is broken, at least for *building* things like the one above. Note that this is *NOT* a bug in R, and sending it to R-bugs was not appropriate. Sending to 'R-devel' would have been appropriate, but really it is recommened to use the Mac specific mailing list, R-SIG-Mac (--> http://stat.ethz.ch/mailman/listinfo/r-sig-mac/ for problems like yours. ak> Can you help me ? Not more than that, but I am sure some of the reader of R-SIG-Mac can help you. Regards, Martin Maechler ak> I work on Mac os X. Thanks ak> -- ak> Anais K
On Mar 12, 2008, at 1:00 PM, anais.khuong at gmail.com wrote:> Hello, > I'm working with R, I try to call C from R. > When I try to compile my file.c to make file.so, with the command : > R CMD SHLIB foo.c > return the message : > gcc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk > -mmacosx-version-min=10.4 -std=gnu99 -dynamiclib > -Wl,-headerpad_max_install_names -Wl,-macosx_version_min -Wl,10.4 - > undefined > dynamic_lookup -single_module -multiply_defined suppress -L/usr/ > local/lib -o > foo.so foo.o -F/Library/Frameworks/R.framework/.. -framework R > /usr/bin/libtool: for architecture cputype (16777223) cpusubtype (3) > object: > /usr/local/lib/libgcc_s.10.4.dylib malformed object (unknown load > command 4) > make: *** [foo.so] Error 1 > > > Can you help me ? I work on Mac os X. ThanksAs Martin kindly pointed out this is not a bug, and thus should not be filed as such. Reading the R for Mac FAQ would help you in the first place and you're asked to do so before posting (see the posting guide). Most likely your developer tools are way too old. As per FAQ you must use Xcode 2.4 or higher. Just in case that doesn't help, re-instal the full version of R. Cheers, Simon