User forums > Help

Adding libraries to project (maybe am i missing something?)

(1/2) > >>

isendrak:
Ahoy everyone,
i'm currently having a "little" problem, regarding the process of adding a 3rd party library to my project (openssl, if that's relevant):
In "Project options"->"Libraries"->"Libraries used in project" i added "openssl (pkg-config)", but for some reason Code::Blocks seems to totally ignore this.
Normally there should be "-lssl -lcrypto" in the linker's command, but it's not there...
So the question is: Am i missing something, or is this a bug/error/foo?

P.S.: In case it's relevant: I'm using Code::Blocks version 13.12 rev 9501 on Ubuntu 16.04.2 LTS.

Jenna:
13.12 is really old, but that should not matter in this case.
What exactly do you add ?

It should be something like:

--- Code: ---`pkg-config foo --cflags`
--- End code ---
or

--- Code: ---`pkg-config foo --libs`
--- End code ---
or in other words, the exact "pkg-config"-command in backticks.
In "Compiler settings -> Other compiler options" for the compiler-stuff and in "Linker settings -> Other linker options" for the linktime related command.
Either on target or on project-level of the build options.

isendrak:
Okay, adding the pkg-config stuff works.  :)

But then, what exactly is the purpose of the "Project options"->"Libraries"->"Libraries used in project" list?  ???

This one:


P.S.: It doesn't make any difference, whether openssl is listed there or not...

Jenna:
Depends on what you add there.
If you just need "-lssl" and "-lcrypto" as linker-command, you should add "ssl" and "crypto" there.

isendrak:
That's in the "Build options"...
The "thing" i was asking about is in the window you get, when you "right-click" the project, select "Properties...", on the tab labelled "Libraries"...

P.S.: It definitly IS working by adding the pkg-config commands in the "Build options", but i still don't understand, what the purpose of the "Libraries used in project" list is, since it seems to have no effect at all...

Navigation

[0] Message Index

[#] Next page

Go to full version