User forums > Help

Compiling SDL

(1/2) > >>

Gamegoofs2:
I just started trying to use SDL. I add all the files to the right folders and did the below quote:

--- Quote from: TDragon on December 02, 2008, 05:32:07 pm ---Unfortunately, the Code::Blocks SDL wizard hasn't been updated since SDL changed its include file layout. Not your fault. To get by this, temporarily copy SDL.h up a level (from "SDL" to "include"). This is just to get the wizard to finish; you should then get rid of the copy and adjust any #include <SDL.h> to #include <SDL/SDL.h>.

--- End quote ---
I got the wizard to make the project but when I go to compile the sample code that Code Blocks supplies it says this:


--- Quote ---It seems this project has not yet been built. Do you want to build it?

--- End quote ---
I said yes, but get this in the build log:

--- Quote ----------------- Build: Debug in SDL ---------------

Linking console executable: bin\Debug\SDL.exe
C:\Program Files\CodeBlocks\MinGW\bin\ld.exe: cannot open output file bin\Debug\SDL.exe: Permission denied
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

--- End quote ---

I'm sure there is an easy fix and I just don't know it. Thanks for you help.

stahta01:
Patch for the wizard; not tested for a few months.

Tim S.



--- Code: ---Index: src/plugins/scriptedwizard/resources/sdl/wizard.script
===================================================================
--- src/plugins/scriptedwizard/resources/sdl/wizard.script (revision 5680)
+++ src/plugins/scriptedwizard/resources/sdl/wizard.script (working copy)
@@ -47,8 +47,15 @@
         local dir_nomacro_inc = GetCompilerIncludeDir(dir, SDLPathDefault, SDLPathDefaultInc);
         if (dir_nomacro_inc.IsEmpty())
             return false;
-        if (!VerifyFile(dir_nomacro_inc, _T("SDL.h"), _T("SDL's include")))
-            return false;
+           
+        if (!IO.FileExists(dir_nomacro_inc + wxFILE_SEP_PATH + _T("SDL.h")))
+        {
+            if (VerifyFile(dir_nomacro_inc, _T("SDL/SDL.h"), _T("SDL's include")))
+                SDLPathDefaultInc = SDLPathDefaultInc + _T("/SDL");
+            else
+                return false;
+        }
+       
 
         // verify library dependencies
         local dir_nomacro_lib = GetCompilerLibDir(dir, SDLPathDefault, SDLPathDefaultLib);

--- End code ---

Gamegoofs2:
The problem isn't with the wizard though. It's when I go to compile the code.

stahta01:
Turn on Full Compiler Log.
http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

Check if EXE was created; if yes try running from command line.

If Vista or Windows 7, turn off security.
And, run Code::Blocks as Admin.

Gamegoofs2:
Here's what full command line gives:

--- Quote ----------------- Build: Debug in SDL ---------------

mingw32-g++.exe -L"C:\Program Files\CodeBlocks\MinGW\lib"  -o bin\Debug\SDL.exe obj\Debug\main.o    -lmingw32 -lSDLmain -lSDL.dll -luser32 -lgdi32 -lwinmm -ldxguid
C:\Program Files\CodeBlocks\MinGW\bin\ld.exe: cannot open output file bin\Debug\SDL.exe: Permission denied
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

--- End quote ---

When I check for the EXE I can't even see the project file. What's up with that?

Navigation

[0] Message Index

[#] Next page

Go to full version