|need help with g++ linker and opencv [message #1782062]
||Fri, 16 February 2018 16:35
| Guillaume Bergeron
Registered: February 2018
Hello everyone, this topic has probably been answered but I couldn't find anything due to my lack of knowledge in the subject so im asking for help to solve my issue. I can cross compile a program (test.cpp) that uses opencv for my raspberry pi using this command in the console |. But when I try to do it in eclipse, it gives me this output
arm-linux-gnueabihf-g++ -o test3 test.cpp `pkg-config opencv --cflags --libs`
16:30:21 **** Incremental Build of configuration Debug for project z ****
Building file: ../test.cpp
Invoking: Cross G++ Compiler
arm-linux-gnueabihf-g++ -I/home/gbergeron -I/home/gbergeron/build/install/include/opencv -I/home/gbergeron/build/install/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"test.d" -MT"test.o" -o "test.o" "../test.cpp"
Finished building: ../test.cpp
Building target: z
Invoking: Cross G++ Linker
arm-linux-gnueabihf-g++ -L/home/gbergeron/build/install/lib -o "z" ./test.o -lopencv_dnn -lopencv_ml -lopencv_objdetect -lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_calib3d -lopencv_features2d -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_video -lopencv_photo -lopencv_imgproc -lopencv_flann -lopencv_core
./test.o: In function `main':
/home/gbergeron/workspaceRPI/z/Debug/../test.cpp:3: undefined reference to `cv::imread(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
makefile:44: recipe for target 'z' failed
/home/gbergeron/workspaceRPI/z/Debug/../test.cpp:4: undefined reference to `cv::namedWindow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int)'
/home/gbergeron/workspaceRPI/z/Debug/../test.cpp:5: undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
/home/gbergeron/workspaceRPI/z/Debug/../test.cpp:5: undefined reference to `cv::imshow(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_InputArray const&)'
collect2: error: ld returned 1 exit status
make: *** [z] Error 1
16:30:23 Build Finished (took 2s.229ms)
I have linked the required libraries in the setting (cross g++ linker) but it just won't work.
Any help is really appreciated im still noob at this =)
(Size: 89.88KB, Downloaded 20 times)
Powered by FUDForum
. Page generated in 0.01463 seconds