Author Topic: easily add libraries like -ldl -lnsl -lm -lrt -pthread -g  (Read 8888 times)

Offline rbrettjuergens

  • Single posting newcomer
  • *
  • Posts: 3
easily add libraries like -ldl -lnsl -lm -lrt -pthread -g
« on: May 17, 2011, 05:13:29 pm »
I'm sure I just managed to missed something in the documentation; but, I was wondering if there is a way to add shared libraries like you would on the gcc command line.  What I've found in the documentation is to:

right click on the project name to the left, select Build options..., select Linker settings tab, click Add, then dig through the file system one by one for each shared library.

Is manually adding each library the only way to do it or can I append libraries like on the gcc command line?  eg. gcc main.c graphics.c -o mygoofyapp -ldl -lnsl -lm -lrt -pthread -g

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: easily add libraries like -ldl -lnsl -lm -lrt -pthread -g
« Reply #1 on: May 17, 2011, 05:39:19 pm »
You can enter the names of the libs directly, instead of browsing the filesystem...
Just type the name of the lib in the popup dialog.

-pthread should be added to the other options both for compiler and linker.
-g is a compiler option and there is a checkbox for it.
« Last Edit: May 17, 2011, 05:41:06 pm by oBFusCATed »
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: easily add libraries like -ldl -lnsl -lm -lrt -pthread -g
« Reply #2 on: May 18, 2011, 12:03:57 pm »
Note that you can type multiple libs in the popup dialog separating them with semicolons, e.g.:


dl;nsl;m;rt


If you type the above in the popup, it will add 4 different entries in the libs list.
Be patient!
This bug will be fixed soon...