C++ undefined reference on constructor
I'm trying to catkin_make my ROS package and I always get this error :
Linking CXX executable devel/lib/sbg_ins_ig500n/sbg_ins_ig500n CMakeFiles/sbg_ins_ig500n.dir/src/node.cpp.o:
In function `main': /home[...]/src/sbg_ins_ig500n/src/node.cpp:24:
undefined reference to `SBGInsIg500N::SBGInsIg500N()' colle
ct2: error: ld returned 1 exit status make[2]: ***
[devel/lib/sbg_ins_ig500n/sbg_ins_ig500n]
Error 1 make[1]: *** [CMakeFiles/sbg_ins_ig500n.dir/all] Error 2 make: *** [all] Error 2
*** Failure: Exit code 2 ***
Since it's an "undefined reference" error, I checked the methods names for any typo but found none and I also checked my code files to be sure the correct header files we're included and everything seems fine. This is the node.cpp code : (The error happens when I try to create an object from the class SBGInsIg500N). The class is located in a folder called "sbg_ins" which is a sub folder of my src directory in my package.
#include "sbg_ins/sbg_ins_ig500n.h"
int main(int argc, char **argv){
SBGInsIg500N s;
...
And this is the CMakeLists file :
cmake_minimum_required(VERSION 2.8.3)
project(sbg_ins_ig500n)
find_package(catkin REQUIRED COMPONENTS sensor_msgs)
find_package(Boost REQUIRED COMPONENTS system)
find_package(catkin REQUIRED COMPONENTS roscpp)
find_package(catkin REQUIRED COMPONENTS tf)
catkin_package(DEPENDS system_lib)
include_directories(${catkin_INCLUDE_DIRS} src/sbg_ins/)
add_executable(sbg_ins_ig500n src/node.cpp)
target_link_libraries(sbg_ins_ig500n ${catkin_LIBRARIES})
## C++11 enable for catkin_build
set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}")
Calling catkin_make on my workspace outputs the error above, is there something I'm doing wrong ?