c - gcc 的奇怪输出

标签 c gcc

我运行了 gcc(在一个 makefile 中),我得到了很多这样的信息:

/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2
/usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2

这是什么类型的错误?

最佳答案

此错误的主要原因之一是您缺少 main() 函数。

int main()
{
  // Your code here
}

关于c - gcc 的奇怪输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20271293/

相关文章:

gcc - Recomile exe with debugging symbols,用于不带调试符号的exe生成的core dump

c++ - 在屏幕上绘制单个像素

c# - 什么是值继承和引用继承?

javascript - 如何将大整数拆分为 8 位整数数组

c - dylib 中的符号,适用于 gcc-4.0,不适用于 gcc-4.2(OSX 默认)

c++ - 将迂腐的 GCC key 应用于 Qt 中的项目时出现很多警告

java - 在 CNI/C++ 代码中实例化模板类

c++ - gcc 4.2 编译器 (Mac OSX) : fpu_control. h: 没有那个文件或目录的新手问题

c - 使用 execl 重定向 ls

c - 将 GotoBLAS2 与 C 结合使用