Page 1 of 1

Wierd behaviour when trying to link a dynamic lib

Posted: Mon Oct 25, 2010 2:37 pm
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

Re: Wierd behaviour when trying to link a dynamic lib

Posted: Mon Oct 25, 2010 2:53 pm
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.

Re: Wierd behaviour when trying to link a dynamic lib

Posted: Mon Oct 25, 2010 7:58 pm
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

Re: Wierd behaviour when trying to link a dynamic lib

Posted: Mon Oct 25, 2010 8:24 pm
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.

Re: Wierd behaviour when trying to link a dynamic lib

Posted: Sun May 29, 2011 6:03 pm
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!!