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
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.
When no one helps you out. Call google();
On my system the default output from cygwin g++ is a.exe (It's Windows, and executables are usually named something.exe.)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
Last edited by Dave Evans; 03-07-2005 at 09:25 AM.
a.out (if it exists) is an intermediate file in cygwin - the actual program you run is the .exe file.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.