问题
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.
回答1:
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
来源:https://stackoverflow.com/questions/59915966/unknown-gcc-linker-error-but-builds-sucessfully