Yet a simple Xcode C++ command line project with changes to Library and Header Search Paths to include /usr/local/lib and /usr/local/include,
changing "Other Linker Flags" to -L/usr/local/lib -lgmp and "Other CFlags" to -O2 -pedantic -m64 -mtune=k8 " , n other words to equal the exact same specs used in the simple command line build, fails.
The build transcript seems to imply both the compiled binary and the library are not of the required architecture--but the project is set to build for the native architecture which should be i386.
That's what the simple command line build does and so it *should* seemingly work.
Obviously something else is configured wrong but I have no idea what it is. What does Xcode do that is special?
Building target “isprime” of project “isprime” with configuration “Debug”
Checking Dependencies
CompileC build/isprime.build/Debug/isprime.build/Objects-normal/i386/isprime.o /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/isprime.c normal i386 c com.apple.compilers.gcc.4_0
cd /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime
/Developer/usr/bin/gcc-4.0 -x c -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D_GLIBCXX_DEBUG=1 -D_GLIBCXX_DEBUG_PEDANTIC=1 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mfix-and-continue -mmacosx-version-min=10.5 -gdwarf-2 -iquote /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/isprime.build/Debug/isprime.build/isprime-generated-files.hmap -I/Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/isprime.build/Debug/isprime.build/isprime-own-target-headers.hmap -I/Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/isprime.build/Debug/isprime.build/isprime-all-target-headers.hmap -iquote /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/isprime.build/Debug/isprime.build/isprime-project-headers.hmap -F/Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/Debug -I/Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/Debug/include -I/Users/daniello/Documents/Projects/Software/_wip/Libs/isprime -I/opt/local/include -I/Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/isprime.build/Debug/isprime.build/DerivedSources -O2 -pedantic -m64 -c /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/isprime.c -o /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/isprime.build/Debug/isprime.build/Objects-normal/i386/isprime.o
In file included from /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/isprime.c:21:
/opt/local/include/gmp.h:1605: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1631: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1642: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1653: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1664: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1692: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1703: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1716: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1734: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1752: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1763: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1774: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:1784: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:2029: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:2042: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:2055: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:2068: warning: ‘__gnu_inline__’ attribute directive ignored
/opt/local/include/gmp.h:2081: warning: ‘__gnu_inline__’ attribute directive ignored
Ld /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/Debug/isprime normal i386
cd /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime
setenv MACOSX_DEPLOYMENT_TARGET 10.5
/Developer/usr/bin/gcc-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/Debug -L/Users/daniello/Documents/Projects/Software/_wip/Libs/isprime -L-L/opt/local/lib -F/Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/Debug -filelist /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/isprime.build/Debug/isprime.build/Objects-normal/i386/isprime.LinkFileList -mmacosx-version-min=10.5 -L/usr/local/lib -lgmp -o /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/Debug/isprime
ld warning: in /Users/daniello/Documents/Projects/Software/_wip/Libs/isprime/build/isprime.build/Debug/isprime.build/Objects-normal/i386/isprime.o, file is not of required architecture
ld warning: in /Developer/SDKs/MacOSX10.5.sdk/usr/local/lib/libgmp.a, file is not of required architecture
Undefined symbols:
"_main", referenced from:
start in crt1.10.5.o
ld: symbol(s) not found
collect2: ld returned 1 exit status