Wierd behaviour when trying to link a dynamic lib

General questions regarding the usage of CodeLite
Patrick
CodeLite Curious
Posts: 3
Joined: Mon Oct 25, 2010 2:27 pm
Genuine User: Yes
IDE Question: C++
Contact:

Wierd behaviour when trying to link a dynamic lib

Post by Patrick »

Hello all.

I am using Codelite on Ubuntu 10.04 version 2.7.0.4375

When I specify a library to link in the project setting dialog (right clicking on the workspace view on the left, selecting settings from the menu, then selecting the linker tag in the dialog and writing SDL in the library field) and then rebuild and compile the project, for some reason the SDL string I specified in the project settings dialog's library tab ends up manifesting itself as -lSDLSDL at compile time ... now that can't be right.

The actual call to the compiler being:

Code: Select all

g++ -o ./Debug/libsdl_template ./Debug/main.o ./Debug/sdl_screen.o ./Debug/sdl_app.o   -lSDLSDL  
/usr/bin/ld: cannot find -lSDLSDL
I'll post a workaround if I find one. By the way - the IDE itself is SUPER!!! Thank you!

Now if there only were a way to specify a costum library to link without the library name ending up repeating it twice when passed as an argument after -l
Patrick
CodeLite Curious
Posts: 3
Joined: Mon Oct 25, 2010 2:27 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Wierd behaviour when trying to link a dynamic lib

Post by Patrick »

Ok... workaround discovered

project settings -> linker tab -> options field = "-lSDL"

Everything works okay.

Although I am not sure that field was meant to be used in such a way.

Anycase, hope it helps if somebody stumbles on a similar problem

Although some clarification about the linker dialog would be appriciated when the author gets around to it and I guess the behaviour I described in the post above still can't be quite right.

And thanks again for a wonderful C++ IDE ... no I am not using sarcasm, the linker thing aside... everything else has been working wonderfully.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Wierd behaviour when trying to link a dynamic lib

Post by eranif »

Patrick wrote:Although I am not sure that field was meant to be used in such a way.
this is a free text field to pass various options to the linker

I cant make it "duplicate" the content here, can you zip and attach the .project file to this post?

Eran
Make sure you have read the HOW TO POST thread
Patrick
CodeLite Curious
Posts: 3
Joined: Mon Oct 25, 2010 2:27 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Wierd behaviour when trying to link a dynamic lib

Post by Patrick »

I couldn't acutally duplicate the behaviour myself when I created a new project - everything worked. But the original project still has the problem, so I made the project as lean as possible (only one file - main.cc with a main function in it) zipped it up and posted it here.
You do not have the required permissions to view the files attached to this post.
samsam598
CodeLite Curious
Posts: 3
Joined: Sat May 28, 2011 8:31 pm
Genuine User: Yes
IDE Question: c++
Contact:

Re: Wierd behaviour when trying to link a dynamic lib

Post by samsam598 »

Patrick wrote:Ok... workaround discovered

project settings -> linker tab -> options field = "-lSDL"

Everything works okay.

Although I am not sure that field was meant to be used in such a way.

Anycase, hope it helps if somebody stumbles on a similar problem

Although some clarification about the linker dialog would be appriciated when the author gets around to it and I guess the behaviour I described in the post above still can't be quite right.

And thanks again for a wonderful C++ IDE ... no I am not using sarcasm, the linker thing aside... everything else has been working wonderfully.
This did a great help to me .I encontered the same issue when I tried to link to gdiplus.a,wxSqlite3.a etc...
Thank you so much!!
Post Reply