User forums > Help

Bug in SDL project wizard?

<< < (2/2)

Barking_Mad:

--- Quote from: mkborregaard on November 08, 2007, 08:38:54 pm ---I have a consistent problem trying to launch SDL projects in code::blocks.
When asked to specify the folder in which I have placed SDL, I get the error: "The folder seems valid, but this wizard could not find the file SDL.h in it".
The file is in there, in a subfolder ("include"). Is this a problem with the wizard?

--- End quote ---

CB Checks the include directory inside the specified SDL base directory (or root), but if you do as i did and unzip the SDL files as theyr are packaged, they will be placed in SDL_root\include\SDL, CB doesn't recognise them there. I copied them out to SDL_root\include and SDL templates and projects seem to run fine.

EDIT: Just read the better solution 2 posts up  :P

Derdonn:
We are in March 2010 and the bug is still there in the SDL wizard : The first time I launched the wizard, a panel opened asking me to specify the search directories for SDL lib. I thought if I leave them empty it will select the default settings. These default setting are probably wrong and now this extra panel never shows up again.

I had to duplicate the header files both in include/. and include/sdl/. to fix the problem and keep my former projects working.

It's not a big deal but all theses bugs in CB Wizards always discouraged me from using CodeBlocks despite I'm glad this tool exists.

stahta01:
The patch I used about 6 to 12 months ago; feel free to submit to BerliOS with your name on it; I do not have the time and energy to test & maintain patches.

Note, It needs tested to verify it still works and was never tested on Linux.

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 ---

Navigation

[0] Message Index

[*] Previous page

Go to full version