Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » trouble with cross g++ linker and opencv libraries
trouble with cross g++ linker and opencv libraries [message #1781855] Tue, 13 February 2018 22:56
Guillaume Bergeron is currently offline Guillaume BergeronFriend
Messages: 3
Registered: February 2018
Junior Member
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
arm-linux-gnueabihf-g++ -o test3 test.cpp `pkg-config opencv --cflags --libs`
. But when I try to do it in eclipse, it gives me this output
16:30:21 **** Incremental Build of configuration Debug for project z ****
make all 
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 =)
Previous Topic:Multiple errors in the "hello world" program
Next Topic:eclipse can't find installed library
Goto Forum:
  


Current Time: Thu Apr 25 22:10:15 GMT 2024

Powered by FUDForum. Page generated in 0.03480 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top