Code::Blocks SDL Ubuntu problem.

Okay, so I have followed Lazyfoo's first SDL tutorial, but an error was encountered. The code is below:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <cstdlib>
#include <SDL.h>

int main(){
SDL_Init( SDL_INIT_EVERYTHING );
SDL_Surface* Heron = SDL_LoadBMP("Ubuntu_Hardy_Heron_Edit.bmp");
SDL_Surface* Screen = SDL_SetVideoMode(960,600,32,SDL_SWSURFACE);
SDL_BlitSurface(Heron,NULL,Screen,NULL);
SDL_Flip(Screen);
SDL_Delay(5000);
SDL_FreeSurface(Heron);
SDL_Quit();
return 0;
}

The error is (it compiles and runs fine (Edit: it does not run - my error for putting this), but displays this in the box containing the build log shows the following message):
--------------- Build: Debug in Test1 ---------------
Linking console executable: bin\debug\Test1
/bin/sh: 1: Syntax error: Unterminated quoted string
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings

Also after checking the debug folder, I found that there was no executable and every time that I try to build and run, it claims that the project has not been built yet and asks "It seems that this project has not been built yet.
Do you want to build it now?"

There is nothing on the site for Code::Blocks on Linux, does anyone else know what it is (and would this be enough information)? Thank you all!
Last edited on
How could it run if there really was no executable?
This sounds fishy too: bin\debug\Test1. Backslashes aren't path separators, so there seems to be something seriously messed up with your project settings.
Create a new project.
Last edited on
Sounds like it would be a problem with C::B rather than SDL. Do other projects work?
It did not run. Yes it does run projects (though all of my other projects (that did work) have been text-based). Also, the backslash problem was my bad copying of what the build log stated (there was no problem with it). I shall try a new project.
Does the project path contain any quotation marks?
No. I have tried to make another project and the same error occurred. I shall try KDevelop.
Okay, so I have tried Anjuta and that seems to dislike SDL too. Would I have set it up incorrectly? I installed all of the relevant libraries with Synaptic Package Manager.
Well, the error message in C::B indicates that the compiler is invoked incorrectly, possibly due to strange unescaped characters (most likely in the path). I tested it and it works fine for me.

For the record, all the steps:
1. Installed the package libsdl1.2-dev
2. Created a new console C++ project in C::B
3. Copy & pasted your code
4. Added "SDL" to link libraries
5. Added "/usr/include/SDL" to search directories
I have done this: the problem was that I had set the kink library to "usr/include/" rather than SDL. THANK YOU EVER SO MUCH!!
Topic archived. No new replies allowed.