程序运行出现以下错误

来源:7-10 案例:指针版本的快速排序【Hoare分割法】

Yarant

2022-06-02

6298cccc00019fbd06990352.jpg"C:\Program Files\JetBrains\CLion 2021.1\bin\cmake\win\bin\cmake.exe" --build C:\Users\Yarant\CLionProjects\Chapter7-pointer\cmake-build-debug --target Chapter7_pointer

[ 11%] Linking C executable Chapter7_pointer.exe

LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1429~1.301\bin\Hostx86\x86\link.exe /nologo @CMakeFiles\Chapter7_pointer.dir\objects1.rsp /out:Chapter7_pointer.exe /implib:Chapter7_pointer.lib /pdb:C:\Users\Yarant\CLionProjects\Chapter7-pointer\cmake-build-debug\Chapter7_pointer.pdb /version:0.0 /machine:X86 /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\Chapter7_pointer.dir/intermediate.manifest CMakeFiles\Chapter7_pointer.dir/manifest.res" failed (exit code 1120) with the following output: MSVCRTD.lib(exe_main.obj) : error LNK2019: 无法解析的外部符号 _main,函数 "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) 中引用了该符号

Chapter7_pointer.exe : fatal error LNK1120: 1 个无法解析的外部命令

红字:
NMAKE : fatal error U1077: “"C:\Program Files\JetBrains\CLion 2021.1\bin\cmake\win\bin\cmake.exe"”: 返回代码“0xffffffff” Stop. NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"”: 返回代码“0x2” Stop. NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"”: 返回代码“0x2” Stop. NMAKE : fatal error U1077: “"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX86\x86\nmake.exe"”: 返回代码“0x2” Stop.
写回答

1回答

bennyhuo

2022-06-02

图看不清哈。错误信息里面关键是这句:

无法解析的外部符号 _main,看看 main 函数是不是定义得有问题
0
0

C语言系统化精讲 重塑编程思想 打造坚实的开发基础

如果通向大牛的道路有捷径,那就是先学好C语言

2208 学习 · 853 问题

查看课程