/usr/bin/gcc-4.2 -dynamic -bundle -o ../../.ext/x86_64-darwin11.3.0/tcltklib.bundle
stubs.o tcltklib.o -L. -L../.. -L/Users/jasonvdm/.rvm/usr/lib - L/System/Library/Frameworks/Tcl.framework -L/System/Library/Frameworks/Tk.framework -L. -L/usr/local/lib -lpthread -framework CoreFoundation -F/System/Library/Frameworks -framework Tcl -lpthread -framework CoreFoundation -framework Cocoa -framework Carbon -framework IOKit -lpthread -framework CoreFoundation -F/System/Library/Frameworks -framework Tk -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -lruby.1.9.1 -lm -ldl -lpthread -ldl -lobjc
ld: in /usr/local/lib/libxml2.2.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [../../.ext/x86_64-darwin11.3.0/tcltklib.bundle] Error 1
make: *** [mkmain.sh] Error 1
I'm getting a make error:
Error running 'make', please read /Users/jasonvdm/.rvm/log/ruby-1.9.2-p320/make.log
There has been an error while running make. Halting the installation.
This is the same for p180. I have installed readline and everything already. I'm trying to install 1.9.3, with similar errors. I've tried installing with clang and readline flags, nothing works.
It appears that this is my main error:
ld: in /usr/local/lib/libxslt.1.dylib, file was built for unsupported file format which
is not the architecture being linked (x86_64) for architecture x86_64
Are you using OSX??
You can try use:
rvm install ruby-1.9.2-p320 --with-gcc=clang
Or:
CC=/usr/local/bin/gcc-4.2 rvm install ruby-1.9.2-p320
Related
I have a problem with linking a compiled program (see github repo for details).
The osx specific makefile section is here:
CFLAGS = -v -arch x86_64 -Wall -fPIC -O2 -I./include $(OPTS)
LDFLAGS = -v -arch x86_64 -lpthread /usr/local/lib/libportaudio.a -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon
EXECUTABLE ?= squeezelite-osx
include Makefile
The compilation works fine, but during the linking it fails with:
Apple LLVM version 7.0.2 (clang-700.1.81)
Target: x86_64-apple-darwin15.2.0
Thread model: posix
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -dynamic -arch x86_64 -macosx_version_min 10.11.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -o squeezelite-osx main.o slimproto.o buffer.o stream.o utils.o output.o output_alsa.o output_pa.o output_stdout.o output_pack.o decode.o flac.o pcm.o mad.o vorbis.o faad.o mpg.o dsd.o dop.o dsd2pcm/dsd2pcm.o process.o resample.o -lpthread /usr/local/lib/libportaudio.a -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework Carbon -lFLAC -lmad -lvorbisfile -lfaad -lmpg123 -lsoxr -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.2/lib/darwin/libclang_rt.osx.a
ld: library not found for -lFLAC
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [squeezelite-osx] Error 1
The library which is not found is in the folder /usr/local/include and I think I have to add this path to the include path of the linker.
How can I add the path /usr/local/include to the include path of the linker?
The linker doesn't use include files; that's the compiler (actually the pre-processor, but let's keep it simple).
Instead you need to tell the linker that it should look in /usr/local/lib using the -L option:
-L/usr/local/lib
Note: you can provide more than one -L option to the linker.
I have used CMake 3.3.0-rc4 to generate an Xcode project for OpenTrack. However, when I attempt to build the ALL_BUILD target in Xcode 6.4, I immediately get the error below.
Libtool build/Debug/libopentrack-version.a normal x86_64
cd /Users/david/Documents/Programming/OpenTrack
export MACOSX_DEPLOYMENT_TARGET=10.10
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static -arch_only x86_64 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -L/Users/user/Documents/Programming/OpenTrack/build/Debug -filelist /Users/user/Documents/Programming/OpenTrack/build/opentrack.build/Debug/opentrack-version.build/Objects-normal/x86_64/opentrack-version.LinkFileList -stdlib=libc++ -framework Cocoa -framework CoreFoundation -lobjc -lz -framework Carbon -o /Users/user/Documents/Programming/OpenTrack/build/Debug/libopentrack-version.a
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: unknown option character `t' in: -stdlib=libc++
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -static [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-sacLT] [-no_warning_for_no_symbols]
Usage: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -dynamic [-] file [...] [-filelist listfile[,dirname]] [-arch_only arch] [-o output] [-install_name name] [-compatibility_version #] [-current_version #] [-seg1addr 0x#] [-segs_read_only_addr 0x#] [-segs_read_write_addr 0x#] [-seg_addr_table <filename>] [-seg_addr_table_filename <file_system_path>] [-all_load] [-noall_load]
The Build Settings for the project has the following set for Linking / Other Librarian Flags:
OTHER_LIBTOOLFLAGS = -stdlib=libc++ -framework Cocoa -framework CoreFoundation -lobjc -lz -framework Carbon
From the libtool usage statement above, it looks to me like this set of options was generated for an entirely different version of libtool. What can I do (if anything) to get this project to build with the current version of Xcode?
You cannot use the flag -stdlib=libc++ or -framework with libtool, as they are valid only in the linker, so you should make OTHER_LIBTOOLFLAGS empty as none of those options apply
I'm getting this error when trying to install curb on my Mac:
/usr/bin/gcc-4.2 -dynamic -bundle -o curb_core.bundle curb.o curb_easy.o curb_errors.o curb_multi.o curb_postfield.o curb_upload.o -L. -L/Users/user/.rvm/rubies/ruby-1.9.2-p318/lib -L/Users/user/.rvm/usr/lib -L. -L/usr/local/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -lruby.1.9.1 -lpthread -ldl -lobjc -lcurl
ld: in /usr/local/lib/libssl.0.9.8.dylib, missing required architecture x86_64 in file for architecture x86_64
collect2: ld returned 1 exit status
make: *** [curb_core.bundle] Error 1
Any suggestions?
seems you need to have 64 bit openssl
check this
Trouble installing pg gem
Got a big problem installing rb-appscript.
I already installed the latest Version of xCode & I'm running Lion.
Hope you can help me, thanks a lot!
This is the Error Message:
sudo gem install rb-appscript
Building native extensions. This could take a while...
ERROR: Error installing rb-appscript:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
create /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/src/osx_ruby.h ...
create /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/src/osx_intern.h ...
creating Makefile
make
Makefile:188: warning: overriding commands for target `/usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/lib'
Makefile:182: warning: ignoring old commands for target `/usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/lib'
gcc -I. -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -Isrc -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -Wall -c src/rbae.c
gcc -I. -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -I/usr/local/lib/ruby/1.8/i686-darwin9.7.0 -Isrc -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -D_XOPEN_SOURCE=1 -fno-common -pipe -fno-common -Wall -c src/SendThreadSafe.c
cc -dynamic -bundle -undefined suppress -flat_namespace -o ae.bundle rbae.o SendThreadSafe.o -L. -L/usr/local/lib -L. -framework Carbon -framework ApplicationServices -lruby -lpthread -ldl -lobjc
ld: warning: ignoring file /usr/local/lib/libruby.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: in /usr/local/lib/libxml2.2.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) for architecture x86_64
collect2: ld returned 1 exit status
make: *** [ae.bundle] Error 1
Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/rb-appscript-0.6.1/./gem_make.out
Seems like something is wrong with your Ruby install. It complains about a wrong architecture here
ld: warning: ignoring file /usr/local/lib/libruby.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64)
ld: in /usr/local/lib/libxml2.2.dylib, file was built for unsupported file format which is not the architecture being linked (x86_64) for architecture x86_64
Be sure your ruby is installed right. For a super-easy Ruby installation, I would recommend the Ruby Version Manager -> https://rvm.io
I'm trying to create a lib with g++ 4.0.1, but it looks for _main (which deliberately isn't in the code). Must I put a _main in there or can I circumvent with some nifty switch? My current command line looks like:
g++ -shared -o mylib.so myobj1.o myobj2.o ...
On a sidenote I'm using g++ powerpc-apple-darwin9, but I'm guessing/hoping that this should be irrelevant. A more complete printout:
$g++ -O0 -ggdb -fPIC -D_DARWIN_C_SOURCE -D_STLP_THREADS -D_POSIX_PTHREAD_SEMANTICS -Istlport/stlport -Iutf8cpp -Ifreealut-1.1.0/include -Iode-0.11.1/include -Iode-0.11.1/ode/src -Iode-0.11.1/ode/src/joints -Iode-0.11.1/OPCODE -Iode-0.11.1/GIMPACT/include -Iode-0.11.1/ou/include -DPOSIX -D_XOPEN_SOURCE=600 -D_DEBUG -D_CONSOLE -DPNG_NO_ASSEMBLER_CODE -DdSingle -DdTLS_ENABLED=1 -DHAVE_CONFIG_H=1 -DLEPRA_WITHOUT_FMOD -framework OpenGL -framework CoreServices -framework OpenAL -DMAC_OS_X_VERSION=1050 -Wno-unknown-pragmas -o myfile.o -c myfile.cpp
$g++ -shared -framework OpenGL -framework AppKit -framework Cocoa -lobjc -lstlport -framework CoreServices -Lstlport/build/lib/obj/gcc/so -L. -Lopenal-soft-1.10.622 -Lfreealut-1.1.0/admin/VisualStudioDotNET/alut -L../Lepra -L../TBC -L../Cure -L../UiLepra -L../UiTBC -L../UiCure -L../Life -framework OpenAL -o libThirdParty.so myfile.o
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libThirdParty.so] Error 1
The solution is to upgrade the compiler. As stated by Adil, 4.1.2 seems to work. Myself, I upgraded to 4.3.4 and that worked great too.