help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running initial code when in library


From: Paulo Matos
Subject: Re: Running initial code when in library
Date: 23 May 2006 15:52:09 -0700
User-agent: G2/0.2

Paul Pluzhnikov wrote:
> "Paulo Matos" <address@hidden> writes:
>
> > Any ideas on how can I know if the code is linked as shared or as
> > static?
>
> What's the link command line?
>
> Add to it '-Wl,--verbose' and you'll see which libraries the linker
> is actually using.
>
> You can also easily verify my guess (that the objects you expect
> aren't actually linked in):
>
> - edit one of the sources that "fails to register", add:
>
>   void function_that_is_never_called() { }
>
> - rebuild
> - run
>
>    nm your_exe | grep function_that_is_never
>
> If the output is nothing, my guess is corect.
> If you get
>
>   <some-hex-number> T function_that_is...
>
> then my guess is wrong.
>

Your guess is correct. Verbose output from linker is wierd:
After the .o files:
ttempt to open ../lib/bf/src/.libs/libbf.a succeeded
attempt to open ../lib/ot/src/.libs/libot.a succeeded
attempt to open ../lib/fm/src/.libs/libfm.a succeeded
attempt to open ../lib/glpkinterface/src/.libs/libglpkinterface.a
succeeded
attempt to open /usr/i686-pc-linux-gnu/bin/libglpk.so failed
attempt to open /usr/i686-pc-linux-gnu/bin/libglpk.a failed
attempt to open /usr/i686-pc-linux-gnu/lib/libglpk.so failed
attempt to open /usr/i686-pc-linux-gnu/lib/libglpk.a failed
attempt to open
/usr/lib/gcc/i686-pc-linux-gnu/../../../i686-pc-linux-gnu/lib/libglpk.so
failed
attempt to open
/usr/lib/gcc/i686-pc-linux-gnu/../../../i686-pc-linux-gnu/lib/libglpk.a
failed
attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.0.2/libglpk.so failed
attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.0.2/libglpk.a failed
attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.0.2/libglpk.so failed
attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.0.2/libglpk.a failed
attempt to open
/usr/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../i686-pc-linux-gnu/lib/libglpk.so
faile
attempt to open
/usr/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../../i686-pc-linux-gnu/lib/libglpk.a
failed
attempt to open
/usr/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../libglpk.so failed
attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.0.2/../../../libglpk.a
succeeded
attempt to open ../lib/ncquest/src/.libs/libncquest.a succeeded
attempt to open /usr/lib/gcc/i686-pc-linux-gnu/4.0.2/libstdc++.so
succeeded
/usr/lib/gcc/i686-pc-linux-gnu/4.0.2/libstdc++.so
attempt to open /usr/lib/liblog4cpp.so succeeded
/usr/lib/liblog4cpp.so
....

 and it goes on. The first lines are the libtool libraries that it
should be linking and that doesn't seem to be happening... right? Why?
I'm using the -static flag, what's the problem?
Last lines before linker are:
/bin/sh ../libtool --tag=CXX --mode=link g++  -ggdb -Wall -std=c++98
-static -Wl,--verbose -o extsat  esatmathcluster.o esatmath.o
esatmoduledispatcher.o esatstatistics.o esattrue.o esatvariable.o
esatcoeflist.o esatfalse.o esatbooleanop.o esateqt.o esatbooleanvar.o
esatineqsystem.o esatcodegen.o graph.o esatefficientcharstr.o
graphdense.o vartable.o graphsparse.o esatstring.o esatsysutils.o
esatargumentsparser.o esator.o esatequiv.o esatand.o esatboolite.o
esatopcreate.o esatnot.o esatxor.o esatimplies.o esatenumerator.o
smt-parser.o smt-lexer.o esatfile.o esatsolver.o esatmodel.o
esatcluster.o extsat.o esatlogger.o ../lib/bf/src/libbf.la
../lib/ot/src/libot.la ../lib/fm/src/libfm.la
../lib/glpkinterface/src/libglpkinterface.la
../lib/ncquest/src/libncquest.la  -lm -lnsl -llog4cpp
mkdir .libs
g++ -ggdb -Wall -std=c++98 -Wl,--verbose -o extsat esatmathcluster.o
esatmath.o esatmoduledispatcher.o esatstatistics.o esattrue.o
esatvariable.o esatcoeflist.o esatfalse.o esatbooleanop.o esateqt.o
esatbooleanvar.o esatineqsystem.o esatcodegen.o graph.o
esatefficientcharstr.o graphdense.o vartable.o graphsparse.o
esatstring.o esatsysutils.o esatargumentsparser.o esator.o esatequiv.o
esatand.o esatboolite.o esatopcreate.o esatnot.o esatxor.o
esatimplies.o esatenumerator.o smt-parser.o smt-lexer.o esatfile.o
esatsolver.o esatmodel.o esatcluster.o extsat.o esatlogger.o
../lib/bf/src/.libs/libbf.a -L/usr/i686-pc-linux-gnu/bin
-L/usr/i686-pc-linux-gnu/lib
-L/usr/lib/gcc/i686-pc-linux-gnu/../../../i686-pc-linux-gnu/lib
../lib/ot/src/.libs/libot.a ../lib/fm/src/.libs/libfm.a
../lib/glpkinterface/src/.libs/libglpkinterface.a -lglpk
../lib/ncquest/src/.libs/libncquest.a
/usr/lib/gcc/i686-pc-linux-gnu/4.0.2/libstdc++.so -lm
/usr/lib/liblog4cpp.so -lnsl

Any ideas on where the problem might be?

Thanks,

Paulo Matos

> Cheers,
> --
> In order to understand recursion you must first understand recursion.
> Remove /-nsp/ for email.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]