Thread: Elib syntax error

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    Elib syntax error

    When trying to compile a program (not one I wrote) on Cygwin, the process aborts with the message that there's a syntax error near

    Code:
    elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
    set -o posix
    Obviously I need to correct it, but can anyone spot where the error is?

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Yep... the line should start with #

    Code:
    #elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    37,532
    So this is something you downloaded from the web?

    If so, what was it?
    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.

  4. #4
    Registered User
    Join Date
    Dec 2010
    Posts
    4

    Downloaded program

    Quote Originally Posted by Salem View Post
    So this is something you downloaded from the web?

    If so, what was it?
    Yes, I downloaded it from the MIT web site. It's designed to add new functions to the ssh executable so you can more easily daisy-chain SSH-enabled servers. That would be great if I could get it to compile, but there seem to be a lot of problems with the code (and it doesn't help that it's completely uncommented).

    The elif fix worked, but now I'm getting a message saying
    Code:
    $'\r': command not found
    syntax error near unexpected token 'LANG'
    LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_TYPE
    etc

    The first line probably means I need to run a DOS to Unix conversion. I'll update if this also fixes the second error. (Doubtful.)

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    I doubt it will, although if you're missing a lot of characters from column 1, that could be why.

    All those things on the bottom row are parts of the locale. I can't imagine why they'd be sitting "naked" in a C file. (Again, maybe missing characters.)

  6. #6
    Registered User
    Join Date
    Dec 2010
    Posts
    4
    Whaddaya know, the conversion fixed both problems. Now I get a message saying that there's an unexpected token associated with "then" in this block of code:

    Code:
    #elif test -f $ac_srcdir/configure.ac ||
    	   test -f $ac_srcdir/configure.in; then
          echo
          $ac_configure --help
    I keep telling myself that at least I'm learning a lot. :-)

  7. #7
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,907
    Because you commented out the elif... line to which said "then" belongs

  8. #8
    Registered User
    Join Date
    Dec 2010
    Posts
    4
    Quote Originally Posted by anduril462 View Post
    Because you commented out the elif... line to which said "then" belongs
    This hasn't hurt any of the other instances of elif-then, though.

  9. #9
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,907
    Probably because the then was on the same line as the elif in those cases. Right now the interpreter sees the following line:
    Code:
    test -f $ac_srcdir/configure.in; then
    which is not valid. You need to either comment out neither or both parts.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 04:09 AM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 02:53 AM
  4. ras.h errors
    By Trent_Easton in forum Windows Programming
    Replies: 8
    Last Post: 07-15-2005, 10:52 PM
  5. Linking error
    By DockyD in forum C++ Programming
    Replies: 10
    Last Post: 01-20-2003, 05:27 AM