Hi,
i'm programing in CodeBlocks (http://www.codeblocks.org/). I would like to add Dlib (http://dlib.net/) library to my project.
How can I do this?
I went to my project "Build options..."->"Search directories"->Compiler and added path to "dlib" folder.
I did the same for "Linker" and "Resource compiler"
(more info abaut adding libaries http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general))
I copied code from this page http://dlib.net/image_ex.cpp.html and I got errors.

After that I copied dlib folder inside project and now my proyect can find dlib library. :)
But I still have some errors.

C:\Projekti\SlikaCGIbin\main.cpp|68|undefined reference to dlib::base_window::set_title(std::string const&)'| C:\Projekti\SlikaCGIbin\main.cpp|75|undefined reference todlib::base_window::wait_until_closed() const'|
C:\Projekti\SlikaCGIbin\main.cpp|76|undefined reference to `dlib::base_window::wait_until_closed() const'|
...

It sounds like you set up the search directories fine, but doesn't seem like you actually linked the required libraries. Right next to the Search directories tab is the Linker settings tab, click this and then press the add button and add the required libraries to your project (you can just type in the name of the libraries so long as you have set the search directory for the linker right to the root folder of all of the dlib libraries).

Go to Project-->Build Options-->Linker Settings tab, then click the Add button so that you can add the name of the file. Libraries must be in the format libXXX.a, same as in unix gcc or g++

After looking at the link you posted all you will get is the source files -- no libraries. So you will have to compile and build it yourself. There should be a doc file that tells you how to do that.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.