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

  • Thread starter Thread starter Tanja
  • Start date Start date
  • Tags Tags
    Eclipse
Click For Summary
The discussion revolves around troubleshooting linker errors encountered while using Eclipse with MinGW++ and the Halcon library. The user, Tanja, is facing an "undefined reference" error, indicating that certain functions from the Halcon library are not being linked correctly. The error messages specify missing references to Halcon functions, suggesting that the issue lies within the library linking process. Key points include the need to verify the accuracy of the library names used in the linker settings, ensuring they match exactly with the expected names in the Halcon library. Additionally, there is a suggestion to check if the correct library files are being included and whether the library paths are set correctly in the project settings. The overall focus is on ensuring proper configuration of the linker options to resolve the undefined references.
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.
 
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...

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