|
From: daniel s. <dan...@gm...> - 2015-07-14 17:39:59
|
Oswald, The command line in question refers to dynamically generated files (conftest.c), so I cannot just type in the shell: gcc -o conftest -g -O2 -pipe -W -Wall -Wshadow -Wstrict-prototypes -ansi -pedantic -Wno-overlength-strings -D_GNU_SOURCE conftest.c -ldb However, if you guide me in achieving this from within the toolchain, I'll happily try it out. On Tue, Jul 14, 2015 at 8:20 PM daniel szmulewicz < dan...@gm...> wrote: > It goes in the direction of my hypothesis. > > nm -D /usr/lib/x86_64-linux-gnu/libdb.so | grep db_create > > 0000000000030f40 T __bam_db_create > 00000000000fa7a0 T db_create > 00000000000fa0d0 T __db_create_internal > 0000000000054810 T __ham_db_create > 000000000006c9a0 T __heap_db_create > 0000000000075c40 T __qam_db_create > > Thank you, Oswald. > > On Tue, Jul 14, 2015 at 7:47 PM Oswald Buddenhagen < > osw...@gm...> wrote: > >> On Mon, Jul 13, 2015 at 11:27:09PM +0000, daniel szmulewicz wrote: >> > The config.log reveals: >> > >> > configure:4723: checking for Berkeley DB >= 4.1 >> > configure:4745: gcc -o conftest -g -O2 -pipe -W -Wall -Wshadow >> > -Wstrict-prototypes -ansi -pedantic -Wno-overlength-strings >> -D_GNU_SOURCE >> > -ldb conftest.c >&5 >> > conftest.c:34:1: warning: function declaration isn't a prototype >> > [-Wstrict-prototypes] >> > main () >> > ^ >> > /tmp/ccaGDsAw.o: In function `main': >> > /home/daniel/isync-isync/conftest.c:37: undefined reference to >> `db_create' >> > collect2: error: ld returned 1 exit status >> > >> > So the linker cannot find the required function. Interesting. >> > >> > If I had to guess, which I really shouldn't because I'm not a C >> programmer >> > at all, the problem is that recent versions of gcc require that you put >> the >> > object files and libraries in the order that they depend on each other. >> In >> > other words, conftest.c should be before -ldb. This is actually >> consistent >> > from what I observe elsewhere in the log, for example conftest.c >> precedes >> > -lsasl2, etc. >> > >> what happens if you use that command line with switched argument order >> to compile the test program manually? that's a rather easy test for your >> hypothesis. >> >> what does >> >> nm -D <whereever your libdb.so is> | grep db_create >> >> produce? >> >> >> ------------------------------------------------------------------------------ >> Don't Limit Your Business. Reach for the Cloud. >> GigeNET's Cloud Solutions provide you with the tools and support that >> you need to offload your IT needs and focus on growing your business. >> Configured For All Businesses. Start Your Cloud Today. >> https://www.gigenetcloud.com/ >> _______________________________________________ >> isync-devel mailing list >> isy...@li... >> https://lists.sourceforge.net/lists/listinfo/isync-devel >> > |