Author Topic: library path problem  (Read 5292 times)

Offline r.stiltskin

  • Multiple posting newcomer
  • *
  • Posts: 48
library path problem
« on: January 26, 2010, 05:28:22 am »
My project is compiling correctly but I'm getting a linker error:
Code
-------------- 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
Code
-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?
« Last Edit: January 26, 2010, 05:43:10 am by r.stiltskin »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: library path problem
« Reply #1 on: January 26, 2010, 07:01:26 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline r.stiltskin

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: library path problem
« Reply #2 on: January 26, 2010, 07:26:52 am »
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.