Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试MinGW通过批处理文件使用编译器运行我的程序。但是当我尝试启动它时,它什么也没说。
MinGW
这是一个代码:
g++ -o Learning.exe Main.o pause
当我刚刚打开.exe文件时,它工作得很好。如何解决?
.exe
如果没有任何问题、错误或警告,GCC 将保持沉默。
您想运行您创建的实际程序吗?现在你只需链接它。
如果没有任何问题,要编译并运行,您可以使用以下命令:
g++ main.cpp -o learning.exe && learning.exe pause
后面的部分&&不会被执行,除非编译过程中没有任何错误(返回值不为0)。
&&