Re: Make build with static library on 10.4
Re: Make build with static library on 10.4
- Subject: Re: Make build with static library on 10.4
- From: Rustam Muginov <email@hidden>
- Date: Sun, 9 May 2010 23:16:13 +0400
Looks like you did not specified the library search path to the libjost.a library.
Try to add -L to your link flags
On May 9, 2010, at 11:00 PM, Andy Wiese wrote:
> I have a small c++ project that builds & uses a static library, which I would like to build with make in 10.4, 10.5, and 10.6.
>
> In 10.5 and 10.6, it builds just fine, but in 10.4 the linking stage doesn't seem to find any of the symbols in the shared library.
>
> The same code builds in Xcode, and I've tried to study Xcode's build output to see what it is doing differently. I believe I am passing the same options to g++ and libtool as Xcode.
>
> Following is the failed make output from this small project. A library file libjost.a is created, and nm and otool seem to show the symbols that ld complains about.
>
> My next step if I can't figure this out will be to create an even small test project, but I am hoping that someone will spot my error and I can avoid that chore.
>
> make -C src/jost
> /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -g -x c++ -Wall -DBOOST_DATE_TIME_NO_LIB -I../../../boost_trunk -I.. -c -o Array.o Array.cpp
> /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -g -x c++ -Wall -DBOOST_DATE_TIME_NO_LIB -I../../../boost_trunk -I.. -c -o Exceptions.o Exceptions.cpp
> /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -g -x c++ -Wall -DBOOST_DATE_TIME_NO_LIB -I../../../boost_trunk -I.. -c -o IntegralType.o IntegralType.cpp
> /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -g -x c++ -Wall -DBOOST_DATE_TIME_NO_LIB -I../../../boost_trunk -I.. -c -o Object.o Object.cpp
> /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -g -x c++ -Wall -DBOOST_DATE_TIME_NO_LIB -I../../../boost_trunk -I.. -c -o Parser.o Parser.cpp
> /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -g -x c++ -Wall -DBOOST_DATE_TIME_NO_LIB -I../../../boost_trunk -I.. -c -o Util.o Util.cpp
> /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -g -x c++ -Wall -DBOOST_DATE_TIME_NO_LIB -I../../../boost_trunk -I.. -c -o Value.o Value.cpp
> /Developer/usr/bin/libtool -static -arch_only i386 -syslibroot /Developer/SDKs/MacOSX10.4u.sdk Array.o Exceptions.o IntegralType.o Object.o Parser.o Util.o Value.o -o libjost.a
> install -m 0755 libjost.a ../../lib/libjost.a
> make -C demo/jsonv
> /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -x c++ -g -Wall -DBOOST_DATE_TIME_NO_LIB -I../../../boost_trunk -I../../src/ -I../../../boost_trunk -c -o jsonv.o jsonv.cpp
> /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -g -Wall -DBOOST_DATE_TIME_NO_LIB -I../../../boost_trunk -I../../src/ -L../../lib -ljost -I../../../boost_trunk jsonv.o -o jsonv
> /Developer/usr/bin/../libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:
> jost::Parser::parse(std::basic_istream<char, std::char_traits<char> >&)
> jost::Parser::instance()
> typeinfo for jost::MalformedJSONStream
> collect2: ld returned 1 exit status
> make[1]: *** [all] Error 1
> make: *** [all] Error 2
>
>
> Any suggestions will be greatly appreciated!
>
> Andy
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-dev mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden