News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

library path problem

Started by r.stiltskin, January 26, 2010, 05:28:22 AM

Previous topic - Next topic

r.stiltskin

My project is compiling correctly but I'm getting a linker error:
-------------- Build: all in demo ---------------

Linking executable: demo
g++: /usr/lib/libplplotcxxd.so: No such file or directory
g++: /usr/lib/libplplotwxwidgetsd.so: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings


I have the PLplot library installed in the /usr/local/ tree.
In ProjectProperties/Libraries I have listed:
plplotd-wxwidgets (pkg-config)
plplotd-c++ (pkg-config)

and under BuildOptions/LinkerSettings I entered:
/usr/local/lib/libplplotcxxd.so
/usr/local/lib/libplplotwxwidgetsd.so
and those paths are correct.

Also, the output from
~$ pkg-config --cflags --libs plplotd-wxwidgets
is
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -I/usr/local/include/plplot -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8  -pthread -Wl,-Bsymbolic-functions -L/usr/local/lib -lplplotwxwidgetsd -lwx_baseu-2.8 -lwx_gtk2u_core-2.8 -lplplotcxxd -lplplotd -lltdl -ldl -lm -lcsirocsa -lcsironn -lqhull -lqsastime -lfreetype
notice that includes -L/usr/local/lib.

I also entered
/usr/local/lib
under ProjectBuildOptions/SearchDirectories/Linker

So why is the linker looking for those libraries in /usr/lib?  What do I have to do to configure this project correctly?

MortenMacFly

Quote from: r.stiltskin on January 26, 2010, 05:28:22 AM
-------------- Build: all in demo ---------------
As always: Please compile enable the full compiler log (see my sig) and post the build log again.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

r.stiltskin

Sorry, I seem to have solved the problem.  I found that I had these entries:
/usr/lib/libplplotcxxd.so
/usr/lib/libplplotwxwidgetsd.so
under Project/Properties/BuildTargets/All/BuildOptions/LinkerSettings/LinkLibraries
which I must have put there (mistakenly) a while ago when I had plplot installed under /usr/lib.

I realize now that there was no reason to have any entries at all for Build Options under the "All" build target because these options apply to the entire project (and in fact there is only one build target).  After deleting them the project links correctly.