kdevelop: editing CMakeLists.txt-Collection of common programming errors

I am having troubles trying to make my project work with kdevelop.

In the CMakeLists.txt I have included the paths to the libraries that I use:

cmake_minimum_required(VERSION 2.4.6)
PROJECT(Ormapi)
INCLUDE_DIRECTORIES("/dir/whatever/local/dir/include") < here is defined global.h
INCLUDE_DIRECTORIES("/dir/whatever/local/src")    

ADD_EXECUTABLE(Ormapi main.cpp OrmAPI.cpp)

main.cpp uses an instance of the class I have defined in OrmAPI.cpp. The problem is when I try to create an instance of any other class defined in the above included_directories, I get the both errors “undefined reference to ” and “undefined reference to “.

This is the call from the constructor of OrmAPI.cpp (Global is the class that exists inside the included directories):

OrmAPI::OrmAPI(){        
 Global::dirs()->addResourceDir("mydir");    

}

I am 99% sure that it is related with the CMakeLists.txt, but I do not know what on Earth can be happening.

Any directions?

  1. Finally found the problem:

    cmake_minimum_required(VERSION 2.4.6)
    PROJECT(Ormapi)
    INCLUDE_DIRECTORIES("/dir/whatever/local/dir/include") < here is defined global.h
    INCLUDE_DIRECTORIES("/dir/whatever/local/src")    
    
    ADD_EXECUTABLE(Ormapi main.cpp OrmAPI.cpp)
    target_link_libraries(Ormapi /dirdir/lib.so)

Originally posted 2013-11-10 00:12:09.