在 Linux 上编译 - 在函数 '_start' 中:(.text+0x20):对 'main' 的未定义引用

Compilation on Linux - In function '_start': (.text+0x20): undefined reference to 'main'

本文关键字:text+0x20 引用 未定义 main start Linux 编译 函数      更新时间:2023-10-16

我想在Linux上编译一系列cpp文件。使用 CentOS 7,在 Konsole 中,我键入 "g++ -std=c++11 main.cpp canvas.cpp patch.cpp utils.cpp",然后出现错误:

/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status

谁能告诉我如何解决这个问题?

似乎您没有定义主函数。

相关文章: