Results 1 to 6 of 6

Thread: Eclipse /bin/sh: 1: Syntax error: "(" unexpected

  1. #1
    Join Date
    Jul 2013
    Beans
    82

    Eclipse /bin/sh: 1: Syntax error: "(" unexpected

    I do not really even understand my problem completely. The idea was to make a window using c++ with Eclipse, the code will be posted bellow. Every time I search for the solution I always manage to find something similar to my problem but never quite it.


    Using:

    Eclipse Kelper CDT


    Things done thus far:



    apt-get install libSDL1.2-dev
    apt-get update
    apt-get upgrade



    Project>Properties
    C/C++ Build>Settings - Tool Settings>GCC C Compiler - Include paths (-l)>"/usr/include/SDL"
    C/C++ Build>Settings - Tool Settings>GCC C Linker - Libraries (-l)>"SDL"

    Code:
    #include <iostream>
    #include "SDL/SDL.h"
    #include "SDL/SDL_opengl.h"
    
    
    using namespace std;
    
    int main(int argc, char *argv[])
    {
        SDL_Init( SDL_INIT_EVERYTHING );
    
        //Set memory usage
        SDL_GL_SetAttribute( SDL_GL_RED_SIZE, 8 );
        SDL_GL_SetAttribute( SDL_GL_GREEN_SIZE, 8 );
        SDL_GL_SetAttribute( SDL_GL_BLUE_SIZE, 8 );
        SDL_GL_SetAttribute( SDL_GL_ALPHA_SIZE, 8 );
        SDL_GL_SetAttribute( SDL_GL_BUFFER_SIZE, 32 );
        SDL_GL_SetAttribute( SDL_GL_DEPTH_SIZE, 16 );
        SDL_GL_SetAttribute( SDL_GL_DOUBLEBUFFER, 1 );
    
        //Window title
        SDL_WM_SetCaption( "Window", 0 );
    
        //Window Size
        SDL_SetVideoMode( 600, 400, 32, SDL_OPENGL );
    
        //Screen color
        glClearColor( 1, 1, 1, 1 ); // RED, GREEN, BLUE , APLHA
    
        //Portion to be displayed
        glViewport( 0, 0, 600, 400 );
    
        //2D rendering
        glMatrixMode( GL_PROJECTION );
    
        //Save it
        glLoadIdentity();
    
        //Disable depth checking
        glDisable( GL_DEPTH_TEST );
    
        //5 seconds Delay
        SDL_Delay( 5000 );
    
        SDL_Quit();
    }




    Build output:



    Code:
    make all  
    
    Building target: XO_Game
    /bin/sh: 1: Syntax error: "(" unexpected
    Invoking: Cross G++ Linker
    make: *** [XO_Game] Error 2
    g++  -o "XO_Game"  ./src/XO_Game.o   -l(-l)>"SDL"
    
    
    Error:


    Code:
    /bin/sh: 1: Syntax error: "(" unexpected


    Could anyone shed some light on this matter and help me out, I am really stuck here


  2. #2
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,297
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Eclipse /bin/sh: 1: Syntax error: "(" unexpected

    Looks like a bug in Eclipse... As a workaround, try

    Code:
    sudo dpkg-reconfigure dash
    in a terminal, and choose "No".
    「明後日の夕方には帰ってるからね。」


  3. #3
    Join Date
    Jul 2013
    Beans
    82

    Re: Eclipse /bin/sh: 1: Syntax error: "(" unexpected

    Ah I m so sorry I wrote a question but than I figured it out, I just repaced the libs to be added. Failed to see this for like 4h. Now I need to ask something compeatly diffrent but copy pasted this. I am so sorry for this.

  4. #4
    Join Date
    Jul 2013
    Beans
    82

    Re: Eclipse /bin/sh: 1: Syntax error: "(" unexpected

    I l lmake another post. Please diregard this one.

  5. #5
    Join Date
    Apr 2012
    Beans
    5,385

    Re: Eclipse /bin/sh: 1: Syntax error: "(" unexpected

    Quote Originally Posted by brick2 View Post
    Project>Properties
    C/C++ Build>Settings - Tool Settings>GCC C Compiler - Include paths (-l)>"/usr/include/SDL"
    C/C++ Build>Settings - Tool Settings>GCC C Linker - Libraries (-l)>"SDL"
    what do you mean by this exactly? did you literally enter (-l)>"SDL" into the 'Libraries' box? that would explain why the gcc command line is showing as

    Code:
    g++  -o "XO_Game"  ./src/XO_Game.o   -l(-l)>"SDL"
    You should just enter the word SDL into the box like this:

    Screenshot from 2013-12-27 19:43:15.png

    Some other libraries will be required as well I think - but that should fix your current error

  6. #6
    Join Date
    Jul 2013
    Beans
    82

    Re: Eclipse /bin/sh: 1: Syntax error: "(" unexpected

    OMG yes I jsut copy pasted it (-l)>"SDL" . I mean how stupid can I get. Again I am realy sorry.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •