Jump to content

OK, now some n00b coding questions on OSX


AriseThePhoenix

Recommended Posts

First of all, I don't expect anyone to answer, but it would be nice...

 

I'm new to OSX/X-code programming but have Visual Studio/C++/C#/.net experience. However I'm looking for a n00b level explanation if anyone is willing to take the time.

 

I have a new Macbook Pro loaded with Snow Leopard and X-code 3.2. I'm looking for step by step instructions on how to get editable code that will compile to a running version of BoE in Mac. I'm looking for the seriously simple version, i.e. 1) Download from here 2) Open X-code and open the ... file 3) Click the Build menu and so on, but with more detail please laugh I don't need the Editors to work initially (I'm not sure anyone has it working anyways?) Just the plain game that will load a party and the main 3 scenarios will do fine.

 

If anyone is willing to do that and respond to some n00b questions I'll likely have after I would greatly appreciate it grin

 

I'm using this project as an impetus for me to learn Mac programming. I'm sure I could grab a book - but for me, that just isn't very interesting. I'd rather be thrown into the fire so to speak and learn by breaking/fixing BoE with some of my own ideas I've had for quite some time.

 

Thanks in advance!!!!

 

AriseThePhoenix

Link to comment
Share on other sites

The BoE source code can be found here.

 

Now that we have that aside I would like to say that trying to learn C++ through the immensely complex source code of BoE without experience will not be easy. Or possible, for that matter. You would do better to grab a book, although I'm not stopping you. smile

Link to comment
Share on other sites

Thanks for the response.

 

I already have a few years of C++/C# experience and have already gone through a good chunk of the code on the Microsoft side. I'm trying to learn the OSX side (Xcode/Carbon/Objective C) and just looking for a little direction on how to get the code in and to compile in the Xcode IDE. I asked for a n00b version as I am new to OSX coding plus thought it might be helpful to others in a n00b form. I've already downloded the opensource Carbon project and have not been able to compile it in Xcode. Hence my request here - probably missing something obvious to an OSX programmer or simply looking at it from the wrong direction due to my MS background.

 

Thanks again!

 

AriseThePhoenix

Link to comment
Share on other sites

So, you downloaded the source code through SVN? The released packages on that site don't actually contain source code.

 

Assuming that's what you've done, what are the problems preventing you from compiling? Tell me what you did, and what sort of error message(s) you got.

Link to comment
Share on other sites

Ahh, I think I might be making some assumptions... when I first looked into this, someone had a "Visual Studio 2005" release (I seem to recall) that I had downloaded (about a year ago.) I was assuming there was some similar "OSX" version of the code available for download for the current "Carbon" release of the BoE game. Am I incorrect? Or is the only "open source" version available for anyone to download being the one on the spiderwebsoftware site that is obviously not compatible with OSX?

 

I appreciate all the prompt responses!

 

AriseThePhoenix

Link to comment
Share on other sites

OK, I've got the code from SVN, saved it in a directory on my Mac HD, and opened the .xcodeproj file.

 

Most of the files were found except for dialogs.xib and the .app files. Here's where my Xcode knowledge starts to get weak. How do I then compile that code to a working executable? I've played with a few of the settings in the dropdown above the default Groups and Files location (options for Debug vs. Release, etc.) and I get tons of errors when it tries to build. This is where I'm looking for some assistance, as I recall these types of issues when I was first getting acclimated to Visual Studio a few years ago. The typical "text book doesn't help" type of stuff as they tell you exactly what you need to do so you can do their examples.

 

I feel like I'm making progress though - thanks! smile

 

AriseThePhoenix

Link to comment
Share on other sites

The dialogs.xib file is for something that I planned to do that was never done; then I decided to do it in a different way. So it's not important.

 

I'd recommend staying in Debug mode, since error reporting (for runtime errors) is generally better.

 

Now... what sorts of errors are you getting? Compile errors, or linker errors? If the former, which file(s)? In fact, if there are fewer than, say, 50 errors, it might be simplest just to post them all here.

 

Also, I'll try building it soonish to see if it might actually be broken.

Link to comment
Share on other sites

Well, if I leave the dropdown to select debug vs. release, etc. it Builds with no errors. It will not build and run as it throws an error:

 

"Error from Debugger: The program being debugged is not being run"

 

I'm guessing this is because the IDE is unfamiliar to me, hence the reason I was hoping to get the step by step instructions to avoid the "OK, I did that and this happened. Now what?" after each step...

 

Or if there is a resource/book you can point me to I'm OK with digging there if it's accessible.

 

Thanks!

 

AriseThePhoenix

Link to comment
Share on other sites

Gah, I've never seen it give a message like that before. At any rate the best single resource is the built-in documentation; try 'Xcode Help' and 'Xcode Quickstart' in the Help menu. I suspect, though that your problem is likely more the way that the project is setup, rather than the way Xcode is supposed to be used.

 

Here's my best guess as to what's wrong: Which target do you have selected? You can find the list under 'Set Active Target' in the Project menu. I just checked out a fresh copy and the 'Common Data Files' target was selected by default, which does not include an executable that can be run. If it's not already, select the 'Blades of Exile' target.

Link to comment
Share on other sites

Well, that means it's at least trying to get something done. What are the first couple of errors? Also, one thing that may not have been obvious, and didn't occur to me until now is that you will need to have the boost libraries installed on your machine in order to compile from source; you can download them from http://www.boost.org/.

 

(Watch out when building boost, it will likely try to build only a single version of itself which will then prevent you from using it to create 'universal' binaries. I had an awful time coercing it to build 4-way intel/ppc 32/64 binaries, and I'm afraid that I don't seem to have kept any notes on what I did, but I think that ppc/intel fat binaries are likely good enough here, to take a look at this discussion when you're working on the install. )

Link to comment
Share on other sites

OK, downloaded boost, read the docs and all the boost libraries called in the code (bind, type_traits/is_pointer, and function) don't seem to require to be built?

 

I think my problem is my "clean" install of X-code and it not being able to find the basic libraries out there?

 

Here's a screenshot of some of the almost 25,000 total errors it found while compiling:

 

screenshot link

Link to comment
Share on other sites

When the developer tools are installed, they install all of the standard headers, both in the typical Unix locations (/usr/include/) and in a set of special places, the software development kits (/Developer/SDKs/), and Xcode knows to look in these places by default. I have had some issues with the new 10.6 SDK's standard C++ headers, but the BoE project is configured to default to the 10.4 SDK by default, I think.

 

With regard to the specific errors your screenshot shows: Some of those are a bit peculiar looking. Would you open up the disclosure triangles by a couple of the "No such file or directory" ones, and check from where they were included? It may also help to click the small button (a pale gray lozenge with dark gray horizontal lines) to show the exact command issued to the compiler, with all arguments. Then we can see where it's actually looking for header files. (Sorry this is such a massive pain; this project is not terribly well set up, having sort of grown organically, and it's showing.)

Link to comment
Share on other sites

  • 2 weeks later...

Sorry to disappear on you guys - thanks for all the responses so far. RL intruded - death in the family frown

 

OK, so I've decided that it appears it may be notably difficult to get this up and running anytime soon. I think I'm just going to play around with a simple tile-based RPG (one character). I work better when I'm able to accomplish something in a reasonably short amount of time.

 

If you have any suggestions on websites/links that have info on handling tile-based games that would be greatly appreciated (or links within this forum.) I'm looking for basic info like handling the graphics. For example, "grabbing" a specific tile off of a graphic that contains multiple tiles - like BoE does - and then drawing it on screen or how to handle layers (ignoring background of higher level layers so you can see lower level layers behind it.) etc etc.

 

Thanks again for all your help and I'll probably return to trying to get BoE running once again after I've got some XP with the above mini-project.

 

Thanks!

 

AriseThePhoenix

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...