I am using CodeBlocks 8.02 on Winodws XP. When I try to create a new project using SDL template, I met the problem that it can not recognize the SDL's installation path (unpacked only) properly. It seems there is a mismatch between SDL versions and Codeblocks versions. Luckily someone already solved this:
On the "New Project" page, right-click your mouse on SDL template, choose "Edit this script", then you can find the following code for patch.
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);
===================================================================
--- 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);
No comments:
Post a Comment