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
Bookmarks