Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » g++ linker issue with opencv(trying to cross compile opencv program works in console but doesn't in eclipse)
g++ linker issue with opencv [message #1782061] Fri, 16 February 2018 16:31 Go to next message
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 =)
  • Attachment: Capture.PNG
    (Size: 89.88KB, Downloaded 5 times)
Re: g++ linker issue with opencv [message #1782241 is a reply to message #1782061] Tue, 20 February 2018 19:55 Go to previous message
Bugra M. Yildiz is currently offline Bugra M. YildizFriend
Messages: 106
Registered: July 2014
Senior Member
Hello Guillaume,

This is the Epsilon forum. Maybe, you can find your answer in some other forum in Eclipse.

Thanks.
Previous Topic:ETL-Trace
Next Topic:Issue with using Haetae
Goto Forum:
  


Current Time: Fri Jun 22 19:23:22 GMT 2018

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

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

Back to the top