How to link libpigpio.a whith ros on Raspberry Pi ? [closed]
Hello, I have a linking error when y try to link my project whith catkin_make:
Linking CXX executable /home/pi/tmp/thibaud/catkin_ws/devel/lib/testpkg/test_pi CMakeFiles/test_pi.dir/src/test_pi.cpp.o: In function main: test_pi.cpp:(.test+0x460): undefined reference to 'gpioInitialise' colect2: ld returned 1 exit status make[2]: [/home/pi/tmp/thibaud/catkin_ws/devel/lib/testpkg/test_pi] Error 1 make[1]: [testpkg/CMakeFiles/test_pi.dir/all] Error 2 make: [all] Error 2 Invoking "make" failed
But this function (gpioInitialise) is declared in the header "pigpio.h" called in my main file "test_pi.cpp". And the functions of "pigpio.h" are in "libpigpio.a", and I link my executable with this line in CMakeList.txt :
target_link_libraries(test_pi ${catkin_LIBRARIES} /usr/local/lib/libpigpio.a)
I've try a lot of configuration but I always have the same problem. Can you help me, please. Thanks.
PS: sorry for my bad english ...