【问题标题】:Compilation on Linux - In function '_start': (.text+0x20): undefined reference to 'main' [closed]Linux上的编译-在函数'_start'中:(.text + 0x20):未定义对'main'的引用[关闭]
【发布时间】: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

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

【问题讨论】:

标签: c++ linux c++11 compiler-errors g++


【解决方案1】:

您似乎没有定义 main 函数。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-11-29
    • 2013-12-29
    • 2014-06-07
    • 2012-06-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多