Trouble Linking Eclipse, MinGW++ and Halcon: Need Help!

  • Thread starter Thread starter Tanja
  • Start date Start date
  • Tags Tags
    Eclipse
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 3K views
Tanja
Messages
43
Reaction score
0
Hi,

I use Eclipse, MinGW++ and the library Halcon and can't get it right. There must be something wrong with the linker options as I get the error message: "undefined reference to ... ".

My settings under -> Properites -> C/C++ Build -> Settings-> MinGw++ Linker -> Libraries
are:

Libraries (-l):
halcon
halconcpp

Library search path (-L):
..\..\lib\x86sse2-win32
..\..\bin\x86sse2-win32

Is there something else I have to consider? Or something wrong with my settings?

Would be great if someone knows a solution. Thanks!
Tanja
 
Physics news on Phys.org
The entire message:**** Build of configuration Debug for project HalconTest ****

**** Internal Builder is used for build ****
g++ -IC:\Program Files\MVTec\HALCON-9.0\include -O0 -g3 -Wall -c -fmessage-length=0 -oRectangleIntoArray.o ..\RectangleIntoArray.cpp
g++ -s -LC:\Program Files\MVTec\HALCON-9.0\lib\x86sse2-win32 -oHalconTest.exe RectangleIntoArray.o -lhalcon -lhalconcpp
RectangleIntoArray.o: In function `main':
C:/Program Files/Eclipse/HalconTest/Debug/../RectangleIntoArray.cpp:25: undefined reference to `_imp___ZN6Halcon6HImageC1EPKc'
RectangleIntoArray.o: In function `ZSt17__verify_groupingPKcjRKSs':
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/locale_facets.tcc:2498: undefined reference to `_imp___ZTVN6Halcon6HImageE'
C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/bits/locale_facets.tcc:2499: undefined reference to `_imp___ZN6Halcon7HObjectD2Ev'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 1171 ms.
 
Those seem to be functions in some Halcon lib, and not to a function that you wrote. The only thing I can think of to check is that the names you are using are exactly correct; e.g., that they don't being with two underscores instead of the single underscore you are using. If that's not the problem, then for some reason the correct lib isn't being found.