SDL and wxWidgets in xcode

Mikamura
Unregistered
 
Post: #1
Hey all,

I've been trying for the past couple of days to find the way in getting SDL and wxWidgets to compile together in xcode. These are the main errors I receive:

/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:28:22: SDL_main.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:29:24: SDL_stdinc.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:30:23: SDL_audio.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:31:23: SDL_cdrom.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:32:25: SDL_cpuinfo.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:33:24: SDL_endian.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:34:23: SDL_error.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:35:24: SDL_events.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:36:24: SDL_loadso.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:37:23: SDL_mutex.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:38:23: SDL_rwops.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:39:24: SDL_thread.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:40:23: SDL_timer.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:41:23: SDL_video.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:42:25: SDL_version.h: No such file or directory
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL.h:44:24: begin_code.h: No such file or directory

I tried looking around but couldn't find anything aside from this: http://code.technoplaza.net/wx-sdl/part1/

Let me clarify my situation a bit...

For my software engineering class me and my team were required to create a game using SDL, and a level editor with wxWidgets.

Both the game and level editor compile and run fine on windows and linux.

I can compile the game just fine (which uses only SDL). I can also compile the sample programs from the wxWidgets's folders just as well.

The problem comes in when I try to compile our level editor, which uses both wxWidgets and SDL (since some of the drawing draws upon our game code, which uses SDL).

I think the problem lies in the fact that I don't have a main() function that serves as the entry point for SDL (which is referred to at http://www.libsdl.org/faq.php?action=lis...ategory=7), since wxWidgets has its own initial function.

So I am wondering if there is any clean way to have SDL and wxWidgets compile correctly, together, in xcode without drastically modifying our code (since it compiles fine on windows and linux)?

In case it helps, I'm currently running PowerBook G4 OS X 10.4.8, xcode 2.4, wxWidgets 2.6.3, and SDL 1.2.11.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Those errors are because you need to tell Xcode where those headers are. You could add a header search path, but really though, you should include them in the usual way -- <SDL/SDL_timer.h> for example.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #3
Actually, the default SDL project includes "/Library/Frameworks/SDL.framework/Headers" in the header search paths. The main SDL.h header includes the rest of the headers for you.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Mikamura
Unregistered
 
Post: #4
I use the format "SDL/SDL.h" for the game code and it seems to compile fine. The things SDL-related that I include in my files are "SDL/SDL.h", "SDL_ttf/SDL_ttf", and "SDL_image/SDL_image."

However, I use those in the default SDL application template provided from the SDL website.

When I try to do the same thing using both SDL and wxWidgets for our level editor, that's where I run into the problem in my original post. The template I use here is from the "minimal.xcodeproj" sample because it's the only way I know how to get wxWidgets compiling correctly in xcode. I tried changing the format of "SDL/SDL.h" to have brackets instead, but that didn't seem to help.

I added "/Library/Frameworks/SDL.framework/Headers" in my header search paths from the above post, and it's not giving those errors about SDL_main.h and the other header files anymore, but it is giving me two new errors that I'm not sure how to tackle:

/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL_stdinc.h:564: error: `iconv_t' was not declared in this scope
/Developer/SDKs/MacOSX10.4u.sdk/Library/Frameworks/SDL.framework/Headers/SDL_stdinc.h:564: error: parse error before `,' token

/Users/paulpechin/Desktop/Downloads/wxMac-2.6.3/samples/minimal/graphicsWX.cpp: In member function `virtual void graphicsWX::draw(Sprite*, float, float, float, float, float, float, int)':
/Users/paulpechin/Desktop/Downloads/wxMac-2.6.3/samples/minimal/graphicsWX.cpp:103: warning: passing `float' for argument 1 of `wxPoint::wxPoint(int, int)'
/Users/paulpechin/Desktop/Downloads/wxMac-2.6.3/samples/minimal/graphicsWX.cpp:103: warning: passing `float' for argument 2 of `wxPoint::wxPoint(int, int)'
/Users/paulpechin/Desktop/Downloads/wxMac-2.6.3/samples/minimal/graphicsWX.cpp:103: warning: passing `float' for argument 1 of `wxSize::wxSize(int, int)'
/Users/paulpechin/Desktop/Downloads/wxMac-2.6.3/samples/minimal/graphicsWX.cpp:103: warning: passing `float' for argument 2 of `wxSize::wxSize(int, int)'
/Users/paulpechin/Desktop/Downloads/wxMac-2.6.3/samples/minimal/graphicsWX.cpp:103: warning: passing `float' for argument 1 of `wxPoint::wxPoint(int, int)'
/Users/paulpechin/Desktop/Downloads/wxMac-2.6.3/samples/minimal/graphicsWX.cpp:103: warning: passing `float' for argument 2 of `wxPoint::wxPoint(int, int)'
/Users/paulpechin/Desktop/Downloads/wxMac-2.6.3/samples/minimal/graphicsWX.cpp: In member function `virtual void graphicsWX::drawScene(camera*, float)':
/Users/paulpechin/Desktop/Downloads/wxMac-2.6.3/samples/minimal/graphicsWX.cpp:156: warning: passing `float' for argument 8 of `virtual void graphicsWX::draw(Sprite*, float, float, float, float, float, float, int)'
/Users/paulpechin/Desktop/Downloads/wxMac-2.6.3/samples/minimal/graphicsWX.cpp:135: warning: unused variable `float newx'
/Users/paulpechin/Desktop/Downloads/wxMac-2.6.3/samples/minimal/graphicsWX.cpp:135: warning: unused variable `float newy'
Build failed (2 errors, 9 warnings)


I haven't modified the original files downloaded from SDL in any way, so I'm not sure why it's giving those.

Thanks for the help thus far.
Quote this message in a reply
Post Reply