c++ - gcc linker: which input libraries are used? -


i'm debugging linker issues ("undefined reference" symbols supposed in library i'm linking with), , i'm not sure whether compiler using right shared library.

the output i'm looking 1 produced ldd, is, list of libraries full paths... can't use ldd compilation fails before producing output.

the closest have far dumping library search path , checking directories 1 one shared lib in question; wondering whether better way of doing this?

i'm debugging linker issues

you much better answers if show actual error , link command line used.

most did this:

gcc -lfoo main.c 

where libfoo.so library defines necessary symbol. read this understand why above command line wrong.

but can't use ldd compilation fails before producing output

your earlier statement said link stage fails. compilation , linking not same thing, please don't mix them up.

i wondering whether better way of doing this

to find out libraries linker using, read man ld. on unix system, command provide better way:

gcc ... -wl,-t 

p.s. note there no such thing "gcc linker" -- distinct tools.


Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -