本文介绍了链接器返回“重定位在符号索引处有一个无效符号...";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!
问题描述
我正在 Ubuntu 上尝试一些代码.我正在尝试运行以下代码
I am trying out some code on Ubuntu. I'm trying to run the following code
当我尝试使用 g++
编译上述代码时,出现以下错误
And when I try to compile the above code using g++
, I get the following error
任何有帮助的帮助或问题链接都会非常有帮助!谢谢!
Any help or links to questions that help would be really helpful! Thanks!
推荐答案
我不确定您的无效重定位错误,但明显缺少的是您没有 main
函数.您需要定义一个名为 main
的应用程序入口点,在全局范围内定义,例如:
I'm not sure about your invalid relocation errors but the obvious thing missing is that you have no main
function. You need to define an entry point to your application called main
, defined at global scope such as:
这篇关于链接器返回“重定位在符号索引处有一个无效符号...";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!
本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!