0

I compile with g++ in MinGW on Win 8.1 and i get many errors like those:

C:/of_v0.9.8_msys2/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x157): undefined reference to `_imp__glutGet@4
C:/of_v0.9.8_msys2/libs/openFrameworksCompiled/lib/msys2/libopenFrameworks.a(ofAppGlutWindow.o):ofAppGlutWindow.cpp:(.text+0x1bb): undefined reference to `_imp__glutGet@4'

My question: What is the meaning of the output? Can somebody paraphrase these output line?
For example: The linker can't find the reference to _imp__glutGet@4in the ofAppGlutWindow.o (object file) that is locate inside the libopenFrameworks.a (.o archive file) ...
... and what is ofAppGlutWindow.cpp? and the adress .text+0x157? and all the things?

  • I looked inside the libopenFrameworks.a file and ofAppGlutWindow.o is there.
  • I searched also inside ofAppGlutWindow.o for strings and _imp__glutGet@4 is there.

gcc version 6.2.0

Important
My question is about understanding the output syntax. I found nowhere a description of the gcc output syntax: what is the meaning of the order of appearance, the meaning of the : the meaning of the () the meaning of the (whitespace), and so on...

For example sometimes is (ofAppGlutWindow.o):ofAppGlutWindow.cpp without spaces around : and sometimes is (.text+0x157): undefined reference with space on the right.

sometimes is like this main.o:main.c:function _Key: error: undefined reference to 'stdscr' with :<space> twice.

So we can assume that : and :<space> are two different symbols?

Is the output syntax of gcc/ld consistent and each symbol/order have a meaning or nobody took care of that; and so it's always to understand in a different way?

iianfumenchu
  • 898
  • 9
  • 14
  • Paraphrased: ofAppGlutWindow.o, compiled from ofAppGlutWindow.cpp at offset 0x157 wants to call a function named _imp__glutGet@4, but I have no idea where to find it. – n. m. could be an AI Jan 01 '17 at 16:57
  • "I searched also inside ofAppGlutWindow.o for strings and _imp__glutGet@4 is there" Of corse it is, how else would it let the linker know it wants to call this function? – n. m. could be an AI Jan 01 '17 at 16:59
  • Thank you! now i understand! I interpreted it the wrong way. I thought that what i compiled was trying to find the reference inside the `ofAppGlutWindow.o`. And not `ofAppGlutWindow.o` itself was trying to find the reference to `_imp__glutGet@4`. And in internet i did't find any reference were i can understand the syntax of the gcc output. – iianfumenchu Jan 01 '17 at 18:07
  • i read the question that @n.m. marked as the related duplicate. I asked about the syntax of the gcc / ld output, in the related question i did't find the answer. That question is a good point to start to understand how compiling and linking works but is not a duplicate of my question (and also not the answer) – iianfumenchu Jan 01 '17 at 18:26
  • @n.m. Actually your first comment is the answer that i searched for. And would be nice for me to know how the output is structured (if is). For ex. what is the meaning of `:` and the meaning of `()` and if they are consistent. – iianfumenchu Jan 01 '17 at 18:33
  • x.a(y.o) means "the file y.o from the archive x.a", – n. m. could be an AI Jan 01 '17 at 20:12
  • @n.m. Why you marked this as duplicate? I asked about the output syntax, and i couldn't find anywhere a description of the output symbols of gcc / ld. This place is an opportunity to get an answer about that (and in the question that you marked as duplicate there isn't an answer about syntax). Not logged in user can't see my question now and can't judge anymore if useful to them. – iianfumenchu Jan 13 '17 at 20:49
  • Not sure what other information you need that is not present in the duplicated question, but un-duplicated it anyway – n. m. could be an AI Jan 13 '17 at 21:22

0 Answers0