问题
I've just started using g++, downloading the latest version from the site, and I've made a simple HelloWorld program.
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
When I try to execute using the powershell window and g++, in the right directory, I use the following command:
g++ HelloWorld.cpp -o HelloWorld.exe
This gives no output and makes no files. I used the -v command as per some other answer I read on the site and it gave me this. I don't know how to proceed and execute my program.
回答1:
I've had the same issue and, after running it with the traditional batch console instead of powershell, I noticed a dll
was missing. The dll error won't pop up in the powershell command line (god only knows why).
In my case it was libisl-15.dll
, but it may be different on your PC.
Hope this helps someone in the world!
回答2:
Command
g++ HelloWorld.cpp -o HelloWorld.exe
does not execute propgam, it just build executable file HelloWorld.exe
.
So, after g++ HelloWorld.cpp -o HelloWorld.exe
check the appearance of HelloWorld.exe
file. If it is, just run it like:
.\HelloWorld.exe
来源:https://stackoverflow.com/questions/45392444/g-does-not-make-any-file-or-give-any-output