Basically, I want to run a .cpp and link several .a files and gcc,fortran. The command is as
g++ -L/Users/myhome/Ipopt-3.10.0/build/lib -lipopt -L/Users/myhome/lcoinmumps -lpthread -framework vecLib -L/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1 -L/usr/local/gfortran/lib -lgfortran -lgcc_static -lcc_kext -lgcc -lSystem -framework vecLib -framework vecLib -lm -ldl -o cpp_example cpp_example.cpp
The error shows as
ld: warning: ld: warning: ignoring file /Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/libgcc_static.a, file was built for archive which is not the architecture being linked (x86_64): /Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/libgcc_static.a ignoring file /Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/libgcc.a, file was built for archive which is not the architecture being linked (x86_64): /Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple-darwin11/4.2.1/libgcc.a
Undefined symbols for architecture x86_64: "MyNLP::MyNLP()", referenced from: _main in ccY99KRH.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status
As bold text shows, the error seems to be I am running on 32bit kernel or CPU. But I am using x86_64: i've changed boost.plist according to here and 'about mac' proves clearly that both hardware and software I am using now is 64bit.
Here seems to have explained that mac architecture(?) somehow could not be recognized 64 bits.
But when I add files (.a .cpp .h) into Xcode and run the project together, it works fine.
Anyone knows why the command line doesn't work? Why my libgcc(i686-apple-darwin11-llvm-gcc-4.2) could not be recognized as 64bit version? And most importantly, how to get commands to work?
BTW, my system is lion 10.7.4