Unknown GCC Linker error, but builds sucessfully
Asked Answered
A

1

7

I'm trying to compile a program that links to the FMOD library in the Eclipse C/C++ IDE. I haven't even included any of the library's headers, I've only added the shared library to the projects dependencies and I get the following linking errors:

Building target: Adventum
Invoking: GCC C++ Linker
g++-8 -L"/home/jkmcameron/Workplace/git/Adventum/Adventum/libs/GLFW" -L"/home/jkmcameron/Workplace/git/Adventum/Adventum/libs/Python" -L"/home/jkmcameron/Workplace/git/Adventum/Adventum/libs/FMOD" -o "Adventum"  ./src/adventum/graphics/Display.o  ./src/adventum/Main.o ./src/adventum/ScriptLoader.o   -lglfw3 -lpython3.8 -lfmodL -ldl -lpthread -lX11 -lvulkan
/usr/bin/ld: /home/jkmcameron/Workplace/git/Adventum/Adventum/libs/FMOD/libfmodL.so: .dynsym local symbol at index 2 (>= sh_info of 2)
/usr/bin/ld: /home/jkmcameron/Workplace/git/Adventum/Adventum/libs/FMOD/libfmodL.so: .dynsym local symbol at index 3 (>= sh_info of 2)
/usr/bin/ld: /home/jkmcameron/Workplace/git/Adventum/Adventum/libs/FMOD/libfmodL.so: .dynsym local symbol at index 4 (>= sh_info of 2)
Finished building target: Adventum

Looking up .dynsym local symbol at index ... has yielded me no clues whatsoever, even if I expand my scope beyond the FMOD library and look for that error, in general, I don't see many hits on google for it, as if the error is tailor-made to inconvenience me. It shouldn't be an issue with the binaries because I've tried multiple versions available on the FMOD website and they all throw the same error, and I don't see anyone else complaining about the binary throwing errors during linking on Linux.

It's possible that Eclipse has a hand in this mess but I'm using the GNU toolchain and even when I set Eclipse to "stop on first build error" it still successfully compiles with these errors as if they're phantom errors.

The program runs just fine and I could probably even ignore the errors if I were lazy enough. Mostly I'm looking for any sort of hint or clue as to what these errors mean because to me C++ compilation and linking tools are the man behind the curtain.

Alfred answered 26/1, 2020 at 6:2 Comment(0)
M
9

It's a just a warning, see https://sourceware.org/bugzilla/show_bug.cgi?id=25135

Looks like FMOD has an invalid symbol table, it doesn't seem to do any harm from reading that bug report though, just the slightly mysterious warning (which doesn't contain the key word "warning").

The gold linker doesn't seem to produce this warning, you can enable it with -fuse-ld=gold

Mannos answered 26/1, 2020 at 7:37 Comment(2)
I wish there was a way to hide that then, it doesn't affect compilation but it shows up as an error in the "Problems" tab of Eclipse which bothers my self-diagnosed OCD that probably doesn't exist. What bothers me is that if this truly is an issue with FMOD then why hasn't anyone brought it up yetStudy
Ok I added "-fuse-ld=gold" to the linker command as per the post you linked, it got rid of the warning though I have no idea what it does. If you add that as a note for posterity sake I'll accept this answerStudy

© 2022 - 2024 — McMap. All rights reserved.