Thread: A.out in Cygwin

  1. #1
    Registered User
    Join Date
    May 2004
    Posts
    215

    A.out in Cygwin

    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

  2. #2
    Registered User
    Join Date
    Mar 2004
    Posts
    494
    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();

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    536
    Quote Originally Posted by osal
    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
    On my system the default output from cygwin g++ is a.exe (It's Windows, and executables are usually named something.exe.)

    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.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Setting SciTE to work with cygwin
    By Witchfinder in forum C Programming
    Replies: 1
    Last Post: 02-21-2009, 04:12 PM
  2. Cygwin Help
    By wannabe723 in forum Windows Programming
    Replies: 10
    Last Post: 01-03-2009, 01:38 PM
  3. cygwin sshd weird behavior
    By jEssYcAt in forum Tech Board
    Replies: 6
    Last Post: 05-19-2008, 02:05 PM
  4. Problems with compiling code in cygwin
    By firyace in forum C++ Programming
    Replies: 4
    Last Post: 06-01-2007, 08:16 AM
  5. Cygwin Server
    By osal in forum Networking/Device Communication
    Replies: 0
    Last Post: 03-07-2005, 12:58 PM