Compiling ToME under Mac OSX
Moderator: Moderator
-
- Higher
- Posts: 79
- Joined: Tue Aug 19, 2008 7:15 pm
Re: Compiling ToME under Mac OSX
So I spent a day playing around with brogue (a really beautiful game--about as pretty as you can get in plain, ascii, i think), messing with its c code, etc. And then I came back to the ToME SDL compiler errors I was having earlier. I solved the problem by telling xcode explicitly where to look; and since xcode defaults to not recursively searching certain directories, I had to be pretty explicit. If any other mac users are interested, let me know. It's probably better to find some other solution though; with my search path xcode is probably finding like ten SDL.h files, and that's a bit unkempt.
But I now have two final errors during linking.
Undefined symbols:
"_luaopen_fov", referenced from:
_boot_lua in main.o
"_luaopen_md5_core", referenced from:
_boot_lua in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Any ideas about these two problems? I think md5 may be the checksum stuff. But I have no idea what fov is. And more importantly I don't know how to get xcode's ld linker to find 'em. What's my next step?
Hope these two lua errors are obvious for some one! Thanks.
But I now have two final errors during linking.
Undefined symbols:
"_luaopen_fov", referenced from:
_boot_lua in main.o
"_luaopen_md5_core", referenced from:
_boot_lua in main.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Any ideas about these two problems? I think md5 may be the checksum stuff. But I have no idea what fov is. And more importantly I don't know how to get xcode's ld linker to find 'em. What's my next step?
Hope these two lua errors are obvious for some one! Thanks.
Re: Compiling ToME under Mac OSX
Yeah, I get the same two errors with beta16. Actually, the fov files already show up in the sources list, but I still get the error. If I try to add the files manually (fov or md5) to the sources list, I then get well over a hundred errors on compile. When that happened, I just gave up.
Re: Compiling ToME under Mac OSX
You probably need to add the c files in src/luamd5/ it should then work
[tome] joylove: You can't just release an expansion like one would release a Kraken XD
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning
--
[tome] phantomfrettchen: your ability not to tease anyone is simply stunning

Re: Compiling ToME under Mac OSX
I don't think Xcode will find "SDL.h" in the SDL framework by default. The path has to be "SDL/SDL.h" for that to work. The workaround is to add the SDL Headers folder to the project:
1: Select Frameworks in the left bar
2: Use project => add to project
3: Navigate to /Library/Frameworks/SDL.framework
4: Select the Headers folder, click add and then click through the next dialog box.
Now you should be able to build, except for the other files not yet added from the t-engine src folder.
1: Select Frameworks in the left bar
2: Use project => add to project
3: Navigate to /Library/Frameworks/SDL.framework
4: Select the Headers folder, click add and then click through the next dialog box.
Now you should be able to build, except for the other files not yet added from the t-engine src folder.
Re: Compiling ToME under Mac OSX
I uploaded a bit updated project settings here:
http://bazaar.launchpad.net/~pelle-mort ... ision/2155
Realised afterwards that it was a 100M+ upload so I hope they'll let it stay.
Anyway, it's an update of the general build settings, using current mac os for debug, and 10.5 for release build (10.4 would not compile).
I also turned off stripping, since that doesn't make much sense for an opensource project.
Finally I went against my own suggestion above and simply added /Library/Frameworks/SDL.framework/Headers to the header search path.
The diff is against b16 sources.
http://bazaar.launchpad.net/~pelle-mort ... ision/2155
Realised afterwards that it was a 100M+ upload so I hope they'll let it stay.

Anyway, it's an update of the general build settings, using current mac os for debug, and 10.5 for release build (10.4 would not compile).
I also turned off stripping, since that doesn't make much sense for an opensource project.
Finally I went against my own suggestion above and simply added /Library/Frameworks/SDL.framework/Headers to the header search path.
The diff is against b16 sources.
Re: Compiling ToME under Mac OSX
This is my first post here. Thx Yufra, Morth and the others who helped me (and other Mac users) compiling this great game. This was too my first XCODE compilation on Mac. From now I will avoid all that days of waiting for a new OSX version. I did Yufra to-do list and added the SDL headers to project as Morth suggested. All worked.Morth wrote:I don't think Xcode will find "SDL.h" in the SDL framework by default. The path has to be "SDL/SDL.h" for that to work. The workaround is to add the SDL Headers folder to the project:
1: Select Frameworks in the left bar
2: Use project => add to project
3: Navigate to /Library/Frameworks/SDL.framework
4: Select the Headers folder, click add and then click through the next dialog box.
Now you should be able to build, except for the other files not yet added from the t-engine src folder.
THIS SHOULD BE STICKY!

PS I compiled b18, 16 non-used variables in code warning.
Re: Compiling ToME under Mac OSX
I noticed the warning list too, not sure what DG has planned for them. I will update the first post to include Morth's correction. Oh, and if you are compiling from SVN and someone reports the revision incorrectly then you will get the bad version problem you reported elsewhere.
<DarkGod> lets say it's intended
Re: Compiling ToME under Mac OSX
By the name of the variables (I think one was simple "j") I believe that is probably the kind of vars used for temp/loop assignment. Not problematic, or are future vars as you said or now just orphan declared vars, probably darkgod win compile environment don't issue warnings about that orphan vars and got lost.yufra wrote:I noticed the warning list too, not sure what DG has planned for them. I will update the first post to include Morth's correction. Oh, and if you are compiling from SVN and someone reports the revision incorrectly then you will get the bad version problem you reported elsewhere.
You probably saw my other post. That SVN revision tip could be useful here.

-
- Yeek
- Posts: 14
- Joined: Mon Jan 25, 2010 12:39 pm
Re: Compiling ToME under Mac OSX
The current Xcode project file (rev 2192) can't compile the project, as already explained in the previous posts, because #include directives for SDL-related frameworks do not work (e.g. "SDL.h" should be "SDL/SDL.h").
To get around this problem, patch "project.pbxproj" a diff below (to be exact, patch "repos/t-engine4/mac/T-Engine/T-Engine.xcodeproj/project.pbxproj"
).
It adds header search path information to the project file.
P.S.
I'm wondering why Mac OS X binary distribution of T-Engine (at least beta 18) supports only i386. I confirmed that the project can be build also in ppc and x86_64.
...BTW, I can provide a "Universal binary build" patch (apply changes to "info.plist" and "project.pbxproj"). The patch adds options "Open in 32-bit mode" and "Open using Rosetta" to Finder's Info of T-Engine.
P.P.S.
Hey, it got lengty for a P.S. Sorry
To get around this problem, patch "project.pbxproj" a diff below (to be exact, patch "repos/t-engine4/mac/T-Engine/T-Engine.xcodeproj/project.pbxproj"
).
It adds header search path information to the project file.
Code: Select all
1079a1080,1085
> HEADER_SEARCH_PATHS = (
> /Library/Frameworks/SDL_image.framework/Headers,
> /Library/Frameworks/SDL_mixer.framework/Headers,
> /Library/Frameworks/SDL_ttf.framework/Headers,
> /Library/Frameworks/SDL.framework/Headers,
> );
I'm wondering why Mac OS X binary distribution of T-Engine (at least beta 18) supports only i386. I confirmed that the project can be build also in ppc and x86_64.
...BTW, I can provide a "Universal binary build" patch (apply changes to "info.plist" and "project.pbxproj"). The patch adds options "Open in 32-bit mode" and "Open using Rosetta" to Finder's Info of T-Engine.
P.P.S.
Hey, it got lengty for a P.S. Sorry

Re: Compiling ToME under Mac OSX
Hi!
I have no experience of compiling let alone on a mac but the only computer I have access to just now is my girlfriends laptop which is on the older os 10.58. Someone said they got it working earlier in this thread but wasn't sure how. It would be ace if someone could tell me what to do other than the main instructions so I don't have to load windows just to run the game.
Thanks, Doug
I have no experience of compiling let alone on a mac but the only computer I have access to just now is my girlfriends laptop which is on the older os 10.58. Someone said they got it working earlier in this thread but wasn't sure how. It would be ace if someone could tell me what to do other than the main instructions so I don't have to load windows just to run the game.
Thanks, Doug
-
- Yeek
- Posts: 14
- Joined: Mon Jan 25, 2010 12:39 pm
Re: Compiling ToME under Mac OSX
Hi Dougiegee.
Hm, I guess you are using a PowerPC Mac laptop. If it's an Intel Mac, you don't have to compile T-Engine4 unless you wanna try a bleeding-edge version of T-Engine4 (see http://te4.org/download).
Anyway, here is instructions:
Hm, I guess you are using a PowerPC Mac laptop. If it's an Intel Mac, you don't have to compile T-Engine4 unless you wanna try a bleeding-edge version of T-Engine4 (see http://te4.org/download).
Anyway, here is instructions:
- You need Xcode. If you don't have it, install it from OS install DVD or download it from Apple Developer Connection.
- Install SDL-related frameworks.
- Run Xcode, open "Xcode"->"Preferences..." from menu and choose "SCM" tab.
- Configure a Subversion (SVN) repository of T-Engine (image below showing example).
- Open "SCM"->"Repositories" from menu. "Check out" the repository somewhere appropriate: the directory created by "check out" is the workspace for programming T-Engine.
- Open a Xcode project file in the checked-out directory: "mac/T-Engine/T-Engine.xcodeproj".
- The Xcode project file is not configured for SCM yet I guess: open "SCM"->"Configure SCM For This Project..." from menu. Now you should see Project "T-Engine" Info window. Click "Configure Roots & SCM..." button.
- Choose SVN for SCM, and the repository you configured earlier for its repository. Also, don't forget to set the root directory (image below showing example).
- Just stick to Project "T-Engine" Info window a little more. Choose "Build" tab, and scroll down to "Header Search Paths" setting row. Set "Configuration" as "All Configurations": subsequent changes are reflected to all configurations including "Release" and "Debug".
- Fill the value with
Code: Select all
/Library/Frameworks/SDL_image.framework/Headers /Library/Frameworks/SDL_mixer.framework/Headers /Library/Frameworks/SDL_ttf.framework/Headers /Library/Frameworks/SDL.framework/Headers
- Back to the default project window. From toolbar, if "Overview" item does not show you an appropriate architecture, choose one (ppc for PowerPC Mac). Then, click "Build and Run" item.
- That's it! Now you should be able to play T-Engine!
Last edited by Shigerello on Fri Jan 28, 2011 1:23 pm, edited 1 time in total.
Re: Compiling ToME under Mac OSX
Thanks for your help. I tried all that after difficulty even finding Xcode for Leopard. When I build I get Build failed (106 errors). I'm not on a power pc, it's a MacBook2,1 but the builds on the download page don't work with Leopard. I may have followed the instructions wrong as I had no idea what I was doing! I'll try again...
Re: Compiling ToME under Mac OSX
All good! Finally got it to work. Thanks for your help. It runs so much faster than in fake windows!
-
- Yeek
- Posts: 14
- Joined: Mon Jan 25, 2010 12:39 pm
Re: Compiling ToME under Mac OSX
You're welcome
P.S
I updated the last post: 1) the Xcode project file can now work with the T-Engine SVN repository, and 2) SDL-related header files are correctly searched in all configurations.

P.S
I updated the last post: 1) the Xcode project file can now work with the T-Engine SVN repository, and 2) SDL-related header files are correctly searched in all configurations.