未知的GCC链接器错误,但构建成功 [英] Unknown GCC Linker error, but builds sucessfully

查看:125
本文介绍了未知的GCC链接器错误,但构建成功的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试编译一个链接到Eclipse C/C ++ IDE中的FMOD库的程序.我什至没有包含任何库头文件,仅将共享库添加到项目依赖项中,并且出现以下链接错误:

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

在索引中查找 .dynsym本地符号... 并没有给我任何线索,即使我将范围扩展到FMOD库之外并寻找该错误,通常我也不会在Google上看不到很多热门,就好像该错误是为给我带来不便而量身定制的.二进制文件应该不是问题,因为我已经尝试了FMOD网站上提供的多个版本,并且它们都抛出相同的错误,并且在Linux上进行链接时,我没有看到其他人抱怨二进制抛出错误.

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.

Eclipse可能会陷入困境,但是我正在使用GNU工具链,即使我将Eclipse设置为在第一个构建错误时停止",它仍然可以成功编译这些错误,就像它们是幻像错误一样.

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.

程序运行正常,如果我很懒的话,我什至可以忽略这些错误.通常,我正在寻找有关这些错误含义的任何提示或线索,因为对我而言,C ++编译和链接工具是幕后的人.

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.

推荐答案

这只是警告,请参阅看起来FMOD的符号表无效,尽管它看起来对读取错误报告没有任何危害,只是有些神秘的警告(其中不包含关键字"warning").

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").

黄金链接器似乎没有产生此警告,您可以使用 -fuse-ld = gold

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

这篇关于未知的GCC链接器错误,但构建成功的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆