I compiled my program with G++ on cygwin, and everything was OK, but then when i pressed ./a.out, i got this error:
./a.out : 23: Syntax Error: "}" unexpected
Printable View
I compiled my program with G++ on cygwin, and everything was OK, but then when i pressed ./a.out, i got this error:
./a.out : 23: Syntax Error: "}" unexpected
You have an open bracket or you have not used a bracket to close it, go to line 23 on your program and see whats going on there.
On my system the default output from cygwin g++ is a.exe (It's Windows, and executables are usually named something.exe.)Quote:
Originally Posted by osal
If you do this:
g++ hello.cpp
You get a.exe
If you are running the Windows commend processor, cmd.exe, you just enter:
a
on the command line to run the program "a.exe".
If you are using bash as your command line interpreter, then you enter:
./a
or
./a.exe
If you do something like this:
g++ -o hello hello.cpp
The executable will be name "hello.exe". If you are running cmd.exe, just enter this on the command line:
hello
If you are running bash:
./hello
or
./hello.exe
does the trick.
Regards,
Dave
a.out (if it exists) is an intermediate file in cygwin - the actual program you run is the .exe file.