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

  • Thread starter Thread starter Tanja
  • Start date Start date
  • Tags Tags
    Eclipse
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting linker errors encountered while using Eclipse, MinGW++, and the Halcon library. Participants are exploring potential issues with linker settings and library references in a C++ project.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant describes their linker settings and the error message indicating "undefined reference" issues, suggesting a possible misconfiguration in the linker options.
  • Another participant asks for clarification on the specific linker error message to determine if it pertains to user-defined functions or library functions.
  • A further reply provides the complete linker error output, indicating multiple undefined references related to Halcon functions.
  • One participant suggests that the undefined references likely point to functions in the Halcon library and recommends checking the accuracy of the function names used in the code.
  • There is a mention of the possibility that the correct library may not be found, implying a potential issue with library paths or naming conventions.

Areas of Agreement / Disagreement

Participants have not reached a consensus on the cause of the linker errors, and multiple potential issues remain under consideration.

Contextual Notes

Participants have not fully explored all possible configurations or dependencies that may affect the linker settings, and there may be unresolved assumptions regarding the library versions or compatibility.

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
 
Technology news on Phys.org
What is the rest of the linker error message? Is it to a function in your code or to a library function that your code is using?
 
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.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
8K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
15K