Page 1 of 1

Compilter Linker flags?

Posted: Thu Jun 09, 2016 6:18 am
by quantlabs
HI there
You have a really nice IDE. Thanks for creating. I am following the instruction to dynamically load classes into a C++ project.

http://stackoverflow.com/questions/4966 ... y-on-linux
Here are the g++ compiler commands:

Code: Select all

g++ -fPIC -shared myclass.cc -o myclass.so
g++ class_user.cc -ldl -o class_user 
Under the project setting, how I do I apply the separate g++ commands with each having their own set of compiler and linker flags? Is this possible to batch in Codelite?

Thanks

Re: Compilter Linker flags?

Posted: Thu Jun 09, 2016 8:11 pm
by eranif
First get familiar with IDE by creating a simple "Hello World": http://codelite.org/LiteEditor/QuickStart
The Linker and Compiler options can be altered by right clicking on the project icon and select "settings" -> Compiler or Linker pages

About your specific issue:
* "-fPIC" is automatically set by CodeLite when creating a shared object - you don't need to add it by yourself, just ensure that you are creating a "Dynamic Library" project (in the above link, select the correct template)
"-ldl" is a library (libdl.so), you need to add it to the library list from: "project settings->linker->libraries" and set there: "dl" (without the "-l")

Eran