【发布时间】:2020-03-25 14:00:24
【问题描述】:
我想在 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.cpp。另请参阅How to create a Minimal, Complete, and Verifiable example。
标签: c++ linux c++11 compiler-errors g++