我想在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
谁能告诉我如何解决这个问题吗?
最佳答案
您似乎没有定义 main 函数。
关于c++ - Linux 上的编译 - 在函数 '_start' : (. text+0x20) 中:对 'main' 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59113807/