Environment:
reference: Windows下的 C++ 编译工具(MinGW-w64 + CMake)_linshuhe1的专栏-优快云博客_windows 编译工具
- Windows10
- Eclipse, IED 工具
- MINGW 64 ( gcc version_8.1.0) 编译,链接工具
-
随便编写一个 C++ 代码文件,然后使用 g++ 来编译生成可执行文件:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}
先编译但不链接,然后链接生成可执行文件:$ g++ -c helloworld.cpp
$ g++ helloworld.o -o helloworld.exe
假如使用 -c 标识,则是编译但不链接,会生成对应的 .o 文件,不设置标识,则会直接生成最终的 .exe 可执行文件。
-

最低0.47元/天 解锁文章
210

被折叠的 条评论
为什么被折叠?



