"Super Mario War" - SDL and C

DaveN
Unregistered
 
Post: #1
So, hi guys!
From a windows-using friend I just got a good tipp; he told me about the game "Super Mario War", a multiplayer-deathmatch-mario-clone ( also with an AI ) that's written in C and SDL. After seeing the good-lokking screenshots I decided to make a quick port, but 'cause I can't programm in any C-Language, I didn't got it to work, even not after a long time trying around with the sdl-libraries to kill those dumb errors.

So because it's written in languages, that are also avaible for the Mac, I thought it shouldn't be much work for a C-developer to make a short port of that game, the sources are also avaible at http://smw.72dpiarmy.com/.

It is avaible for Linux, Windows, the XBox and the PS2.

mfg Dave

Edit: That's where I get the error:

I use this command to compile:
Code:
g++  -I/usr/local/include/SDL -D_THREAD_SAFE -Wall -I. -Dstricmp=strcasecmp -DSleep=SDL_Delay build/MapList.o build/gfx.o build/map.o build/SFont.o build/main.o build/gamemodes.o build/player.o build/interactionobject.o build/menu.o build/splash.o build/eyecandy.o build/sfx.o  -L/usr/local/lib -lSDLmain -lSDL -framework Cocoa -framework OpenGL -framework SDL_net -framework SDL_image -framework SDL_mixer -framework SDL_net -o smw

But he searches for the SDL Library at the @executable_path, but the executable isn't even compiled:
Code:
/usr/bin/ld: warning can't open dynamic library: @executable_path/../Frameworks/SDL.framework/Versions/A/SDL (checking for undefined symbols may be affected) (No such file or directory, errno = 2)
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #2
Instead of compiling from the command line, try just dumping all the files into an XCode project and putting SDL in a copy frameworks rule for the executable. It would probably be quite a bit easier.
Quote this message in a reply
Apprentice
Posts: 15
Joined: 2005.12
Post: #3
I have been porting a SDL game to Mac, and I encountered a few SDL issues along with endian bugs. I am not sure how much this will help, but I included the following commandline options:
-I/Library/Frameworks/SDL.framework/Headers -I/Library/Frameworks/SDL_net.framework/Versions/A/Headers/
...while I was using SDL and SDL_net frameworks. You are pointing to -I/usr/local/include/SDL, which I think are non-framework libraries.

For my linking options I included -headerpad_max_install_names so that I could go back later with install_tool to fix my @executable_path problem...but that was a problem with OpenAL I think.

A question for akb825: is there a good tutorial for moving a SDL program from commandline to Xcode? I do not completely understand how to use Xcode. I tried dumping my source code into Xcode using a SDL template, but I could never get a successful compile. Commandline works just fine though.
Quote this message in a reply
Member
Posts: 35
Joined: 2006.03
Post: #4
If you do get this ported, could you post a download link here. This game looks like a lot of fun.
Quote this message in a reply
DaveN
Unregistered
 
Post: #5
So, I managed to get it ported like two days after posting the first post, but thanks a lot for the help, anyway. The hardest thing was, that I couldn't just compile it, there were somethings in the code that didn't worked with my compiler, so I changed these things per XCode.
To run it, just use the applescript-application in the folder, it's called "Super Mario War" or something like that. And DON'T CHANGE the name of the binary file "smw". Oh, and you've got to have SDL installed..

File: http://home.pages.at/davenaegeli/smw-1.6...0DaveN.zip [ Zipped 7.2 MB / Unzipped 32MB ]

mfg dave

PS: Tell me if there are some bugs, please..
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #6
You really should include the SDL framework. It would be best if you create a package rather than just an executable file and add a copy frameworks build phase. Telling people to install something else is really not the best idea, especially when you can easily include it with your executable.
Quote this message in a reply
Member
Posts: 35
Joined: 2006.03
Post: #7
Whenever I open it it says:
dyld: ./ smw can't open library:
@executable_path/ ../
Frameworks/SDL.framework/
Versions/ A/SDL (No such file
or directory, errmo = 2)
Quote this message in a reply
Member
Posts: 257
Joined: 2004.06
Post: #8
Apparently, the SDL_net framework needs to be in there too.

The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
Quote this message in a reply
Member
Posts: 257
Joined: 2004.06
Post: #9
lokijki Wrote:Whenever I open it it says:
dyld: ./ smw can't open library:
@executable_path/ ../
Frameworks/SDL.framework/
Versions/ A/SDL (No such file
or directory, errmo = 2)


You'll have to go to http://www.libsdl.org/ and install SDL or put it in your ~/Library/Frameworks folder.

The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
Quote this message in a reply
Member
Posts: 35
Joined: 2006.03
Post: #10
Now it says:
dyld: ./ smw can't open library:
@executable_path/ ../
Frameworks/SDL_image.framework/
Versions/ A/SDL (No such file
or directory, errmo = 2)
Quote this message in a reply
Member
Posts: 257
Joined: 2004.06
Post: #11
Go back to libsdl.org and keep on downloading and installing libraries until you can play the game. In this case, you'll need SDL_image and probably SDL_net since I needed that one.

The brains and fingers behind Malarkey Software (plus caretaker of the world's two brattiest felines).
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #12
It works. It seems to have some uninitialized variables for the game modes, since they start at very high numbers, then move to, say, 5.

As a side note, I had to install 5 separate SDL libraries in order to get this to work. That is unacceptable, IMO. You really should package the ones you need.
Quote this message in a reply
Member
Posts: 35
Joined: 2006.03
Post: #13
I got it to work, and its a lot of fun. But the player 1 powerup buttons won't work.
Quote this message in a reply
SpookMonkey
Unregistered
 
Post: #14
I was able to get the game running, but only after downloading 4-5 libraries. Plays good, and it's a lot of fun.

Though, any chance anyone's made an Xcode project for this game? I'm still fairly new at this stuff, and I'm having a heck of a time trying to get Xcode setup to do anything with the code I pulled from their CVS.
Quote this message in a reply
Apprentice
Posts: 19
Joined: 2005.07
Post: #15
Mine says 'Can't make <<class ctnr>> of item "sef:desktop:smw-1.6:super mario war.app" of application "finder" into type string.'
Quote this message in a reply
Post Reply