Linking error in linux

General questions regarding the usage of CodeLite
mosin
CodeLite Enthusiast
Posts: 12
Joined: Mon Feb 22, 2010 2:02 am
Genuine User: Yes
IDE Question: c++
Contact:

Linking error in linux

Post by mosin »

Hi,

I'm running Codelite 2.5 on linux and I have some problems at the end of the compilation. I have several projects in my workspace which all output a static library (.a). I have an executable project that links with all those libraries. I added the linking folders and the libraries to link with but I always have errors.

Code: Select all

g++ -o /home/svn/simulator/Binaries/linux/Simulator_d /home/svn/simulator/Temp/Linux/Debug/Executable/LinuxMain.o  "-L." "-L/usr/X11R7/lib"  -lusb-1.0 -lX11 -lGL -l/home/svn/simulator/Temp/Linux/Debug/libLogic -lz -l/usr/lib/libcrypt 
 
/usr/bin/ld: cannot find -l/home/svn/simulator/Temp/Linux/Debug/libLogic
the libLogic.a exists in the folder it tries to locate it... That's why I don't get it. Does anyone had that problem? Am I doing something wrong or it's an issue?

Thanks in advance!!
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Linking error in linux

Post by eranif »

Try this:

Remove the entry which u used for adding 'libLogic' in the 'project settings -> linker' tab.

Next, in the same page (project settings -> linker) add under the 'Library path' field:

Code: Select all

/home/svn/simulator/Temp/Linux/Debug/
and under 'Libraries' add:

Code: Select all

Logic
This will result in this link link:

Code: Select all

-L/home/svn/simulator/Temp/Linux/Debug/ -lLogic
Eran
Make sure you have read the HOW TO POST thread
mosin
CodeLite Enthusiast
Posts: 12
Joined: Mon Feb 22, 2010 2:02 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Linking error in linux

Post by mosin »

Hey!

Yeah, it worked. So, is it an issue you could fix for a future release?

Thanks!!
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Linking error in linux

Post by eranif »

There is no bug to fix

The field 'Library path' should contains a semi-colon list of all the search paths
The field 'Libraries' should contain a list of semi-colon list of all libraries to link with - without the path.

Please read this for more information on the project settings dialog:
http://codelite.org/LiteEditor/ProjectSettingsSummary

Eran
Make sure you have read the HOW TO POST thread
Post Reply