Trying to Compile from Source
Author | Topic: Trying to Compile from Source |
---|---|
Shock Trooper
Member # 10488
|
written Sunday, December 16 2007 11:27
Profile
Okay, I'm trying to compile the BoE source code on a Mac. It compiles*, links, and runs, but instantly exits with status 1. (One time it was status 5.) There isn't even a chance to debug to find where the problem is. It's almost like it has an error before it even gets to main(). Does anyone know how I can get it to run? *Except the scenario editor, which is missing a constant. This should be easy to fix. Also, is there any simple way to get rid of the tons of "deprecated" warnings? Or is the only solution to hunt through the documentation? Or... is it simply because Carbon is being phased out? (At least I thought it was...) [ Sunday, December 16, 2007 11:28: Message edited by: Celtic Minstrel ] Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Infiltrator
Member # 5576
|
written Sunday, December 16 2007 13:09
Profile
Homepage
Which copy of the source code were you using? EDIT: Carbon is not being phased out, but Quickdraw most certainly is. In XCode you should be able to turn those warnings off by going to the project build settings and unchecking the 'Warn About Deprecated Functions' item. [ Sunday, December 16, 2007 13:18: Message edited by: Niemand ] -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Post Navel Trauma ^_^
Member # 67
|
written Sunday, December 16 2007 13:32
Profile
Homepage
I'd guess that the resource files are being mangled/not found/something. You can get the resources here: http://khoth.ath.cx/~khoth/Resources.zip If you put them in the directory the program is made in (build/{Debug,Release}/), then it might work. -------------------- Barcoorah: I even did it to a big dorset ram. New Mac BoE Posts: 1798 | Registered: Thursday, October 4 2001 07:00 |
Shock Trooper
Member # 10488
|
written Sunday, December 16 2007 14:02
Profile
Thanks, it was that the resource files were not where they were expected to be. Now, can someone explain this: "\p::::bladesofexile.rsrc" I know \p is the length byte, but why are there so many colons? Edit: Oh, I'm using Khoth's source. Not the OBoE source, just the BoE source. And thanks, Niemand, for the tip. [ Sunday, December 16, 2007 14:04: Message edited by: Celtic Minstrel ] Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Post Navel Trauma ^_^
Member # 67
|
written Sunday, December 16 2007 23:14
Profile
Homepage
The colons are to back out of directories. It starts by looking in the same directory as the executable file, but since that's "Blades of Exile.app/Contents/MacOS/", inside the bundle, it's kind of an inconvenient place to put them, so it's easier to go out and look in the same directory as the bundle. -------------------- Barcoorah: I even did it to a big dorset ram. New Mac BoE Posts: 1798 | Registered: Thursday, October 4 2001 07:00 |
Shock Trooper
Member # 10488
|
written Monday, December 17 2007 07:12
Profile
:/ I can't quite seem to figure out how those paths work. At least, "\p::Resources:bladesofexile.rsrc" fails even though the file exists in the Resources folder within the bundle. It fails with one or three trailing colons, too. Anyway, I increased the maximum number of scenarios listed in the Choose Scenario dialog to 50, as well as omitting the default three from said listing. The hardest part was finding where to apply the changes. :rolleyes: Edit: I also put this number into a constant (kMaxScenarios) to make it easier to change. [ Monday, December 17, 2007 07:16: Message edited by: Celtic Minstrel ] Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Post Navel Trauma ^_^
Member # 67
|
written Monday, December 17 2007 09:42
Profile
Homepage
Using darcs to record your changes: "darcs record *.c *.h" will make it ask about your changes one by one. The changes you say yes to will be recorded into a patch. (If you don't specify the *.c *.h, then it'll ask about changes in the .xcode part, which are generally pointless) To get the patch to me, do "darcs send -o somefilename", say yes when it asks about your patch, then email me somefilename as an attachment. (darcs send with no arguments will try to email it, but gmail rejects emails from random people's computers). -------------------- Barcoorah: I even did it to a big dorset ram. New Mac BoE Posts: 1798 | Registered: Thursday, October 4 2001 07:00 |
Shock Trooper
Member # 10488
|
written Tuesday, December 18 2007 05:44
Profile
Is there any way to determine which bit of code is causing it to exit with status code 1? Or, for that matter, any other status code. (I'm working on the PC editor, by the way.) Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Post Navel Trauma ^_^
Member # 67
|
written Tuesday, December 18 2007 16:37
Profile
Homepage
Running it in the debugger sounds like your best bet, but if it's not even getting that far, I'm not sure what you can do. -------------------- Barcoorah: I even did it to a big dorset ram. New Mac BoE Posts: 1798 | Registered: Thursday, October 4 2001 07:00 |
Shock Trooper
Member # 10488
|
written Tuesday, December 18 2007 18:01
Profile
I guess I'll have to look through the entire code. :rolleyes: (Edit: Or maybe there's am error in the settings...) Does ExitToShell() give status code 1? If yes, does anything else give the same status code? Edit 2: Start with Performance Tool -> MallocDebug makes slight progress - instead of exiting with status 1, it quits unexpectedly. I'm not sure I'll be able to decipher the crash report to find out why, though. [ Tuesday, December 18, 2007 18:23: Message edited by: Celtic Minstrel ] Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Infiltrator
Member # 5576
|
written Tuesday, December 18 2007 19:12
Profile
Homepage
I would recommend running with the debugger and stepping through the startup functions to find out where it exits. Furthermore, if you use the debugger even if you don't set any breakpoints, the debugger may catch where it goes wrong or crashes and show you what it was doing at that moment. And by all means, show us the crash report; these are almost alawys more helpful than most people give them credit for. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Shock Trooper
Member # 10488
|
written Wednesday, December 19 2007 06:46
Profile
The trouble is, even if I set a breakpoint at the top of main, it doesn't pause there so I can step through. Anyway, here's the crash report. Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Infiltrator
Member # 5576
|
written Wednesday, December 19 2007 08:26
Profile
Homepage
Um, are you running this under Rosetta? I've never worked with Rosetta, but all of the "PPC (translated)" and so forth looks like it could well be. Let's see if we can turn this into a Universal Binary, shall we? Although I still can't get my copy to load its resources properly, I had no trouble building it after I used the following settings: (You can copy this block, go to XCode's project settings, select a line and hit paste, it should sort the pasted data out nicely into seperate items.) See if this helps any (or works, my machine is PPC, so I have to guess at getting intel stuff to work). I would guess that you can't debug applications running under Rosetta because the application itself isn't really running; what's running is Rosetta interpreting the application's code. -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Shock Trooper
Member # 10488
|
written Wednesday, December 19 2007 10:41
Profile
Well, that doesn't seem to work. The crash no longer occurs, but I still can't debug it. :/ quote:I tried to do this, but I don't think it worked properly. The "patch" seems to be almost the entire file that I added a few lines to, without my added lines, and with a hyphen in front of each line. Shouldn't there be a plus in front of some lines? Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Shock Trooper
Member # 10488
|
written Monday, December 24 2007 06:24
Profile
Progress! The character editor now loads its main resource file, but it's now having problems creating a new GWorld (QuickDraw error -50). I haven't figured out what the error means yet. [ Monday, December 24, 2007 06:25: Message edited by: Celtic Minstrel ] Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Shock Trooper
Member # 10488
|
written Monday, December 24 2007 14:12
Profile
(sorry about the triple post) I think the following chunk of code is somehow to blame for the PC editor currently not working. The odd thing is that for PICT ID 5000, which has a width of 380 pixels and a height of 70 pixels, pic_rect is set to (t=3072, l=2560, b=20992, r=-31231). I don't understand why it doesn't work. The error occurs at the NewGWorld; it returns -50 which is a paramErr (illegal parameter), and I suspect it is because the rect is bad. Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Apprentice
Member # 11730
|
written Monday, December 24 2007 17:27
Profile
Homepage
While what I am doing does not use the Mac sources (as I have only a little idea on how Windows sources work, much less Mac ones...), I have figured out a way to determine which parts of Blades of Exile need porting from Win16 to Win32. Simply put, Winelib can parse the sources and attempt to build them. Winelib does not suppport anything the Win32 API does not support, and thus the parts of the Win16 API dropped from the Win32 API are given back as errors, stopping the build. BoE game source: PC editor: Scenario Editor: I would have preferred -Wall switch enabled, but that's too much pain at once.... Apparently, the code is C++, here I thought it was C when i glanced at the Mac vs Win16 sources and saw how similar they were... Hey, at least it's progress... These files are being built using autogenerated makefiles from Winemaker. By no means is Winelib a substitute for a genuine native port to Linux. It is merely a stopgap development measure. Note: Pushed fix in filename to Mercurial repository.... [ Monday, December 24, 2007 17:34: Message edited by: King InuYasha ] Posts: 29 | Registered: Friday, November 9 2007 08:00 |
Infiltrator
Member # 5576
|
written Wednesday, December 26 2007 11:41
Profile
Homepage
quote:I bet I know why! See this thread . -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Shock Trooper
Member # 10488
|
written Wednesday, December 26 2007 13:28
Profile
Do you mean this? It sounds like the right solution, yet it still doesn't work. :/ I had actually thought it was a problem from GetPicture which wasn't caught until the NewGWorld call. This also doesn't work if I put NULL instead of GetGDevice() and omit noNewDevice. It doesn't even work if I specify the bit depth in the second argument. :/ Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Infiltrator
Member # 5576
|
written Wednesday, December 26 2007 15:07
Profile
Homepage
Hm. Are you getting the picture's rectangle using the function that Jeff suggests in the other thread? -------------------- Überraschung des Dosenöffners! "On guard, you musty sofa!" Posts: 627 | Registered: Monday, March 7 2005 08:00 |
Shock Trooper
Member # 10488
|
written Wednesday, December 26 2007 16:57
Profile
Hmm. You must mean this: QDGetPictureBounds( current_pic_handle, &pic_rect); instead of this:pic_rect = ( **( current_pic_handle) ).picFrame; Thanks, that problem seems to have been overcome. The window is still not drawn though. I'm about to see if I can locate the reason.Posts: 334 | Registered: Friday, September 14 2007 07:00 |
Apprentice
Member # 11730
|
written Thursday, December 27 2007 15:38
Profile
Homepage
Yay! I feel somewhat happy! As simple as it is, it still means I managed to actually port some code! First rev of wx basics: http://hg.sharesource.org/oboecross32/rev/6860af0cad94 Edit: oops, corrected slight error: http://hg.sharesource.org/oboecross32/rev/a40065e2900c *Dances a little, then realizes big problem* OH SNAP! There is a Mac codebase file in the Windows codebase... "./ScenEd/townout.cpp" is the Mac Scenario Editor codebase file "townout.c" [ Thursday, December 27, 2007 15:49: Message edited by: King InuYasha ] -------------------- Open Blades of Exile Cross 32-bit Project Know any Win16=>Win32 porting resources? Let me know! Posts: 29 | Registered: Friday, November 9 2007 08:00 |