XCode project build options + makefiles = compiling fun!

Lavareef
Unregistered
 
Post: #1
Hello there, I'm not new to C++ but I am somewhat new to game development and completely new to XCode. The following is my last two months of Google searching and strife, with the relevant parts summed up. Apologies if this is in the wrong section.

I'm working on the mac side of a cross-platform game with someone else. It's using C++/OpenGL, no SDL. After numerous STL-related compiler problems, we managed to get the thing compiling properly using a makefile which compiles using g++. The problem with this is that in order to compile, I have to go into the terminal, make, move the executable to a /Release directory, cd to the directory and run the executable. This isn't really fun for development.

If I try and set an external build target using in XCode, it will only say "failed" or "succeeded". No error output, and that line is almost always wrong, failing then producing a working executable or succeeding with nonsense junk in the code.

After asking elsewhere and doing yet more googling, I decided to scrap the external target idea and once again work in XCode directly. Problem is, as before, I now get 960(!) errors in code which compiles fine with the g++-referencing makefile. None of these errors are actually in my code, they are all in files such as stl_algo.h and cstring.h

Here's the question: I suspect that there is something in the makefile (linking, general compiler options) which I need to add to the project's build options, but having not worked with XCode before I'm unsure what this looks like, being presented only with a scary-looking list of possible build options. What sort of thing is it likely that I need change from XCode's default "c++ tool" build options in order to get this thing compiling?

I can post the makefile if it helps, and any and all help at this issue would be appreciated. I feel like i'm close to getting this working and it's a simple matter of turning a metaphorical screw, the problem is just knowing which screw to turn.

Cheers,
Rob
Quote this message in a reply
Lavareef
Unregistered
 
Post: #2
Actually, an an afterthought, here's the makefile in question:

Quote:CC = g++
CFLAGS = -g
OBJECTS = AnimationList.o AnimSprite.o ArbitaryObjectRepository.o BitmapText.o CommonControl.o ConfigMan.o Cube.o CubeMenu.o FileUtil.o InputManager.o InputTest.o Log.o Main.o MenuSystem.o MenuTimer.o NetworkManager.o Number.o Screen.o Sound.o Sprite.o String.o TextureManager.o ThemeManager.o

ABC : $(OBJECTS)
$(CC) $(CFLAGS) $(OBJECTS) -o $@ -framework GLUT -framework OpenGL -lpthread -Lglpng/lib/ -LFMod/lib/ -L"/System/Library/Frameworks/OpenGL.framework/Libraries" -lglpng -lGLU -lGL -lfmodex

$(CC) -c $(CFLAGS) $*.cpp

clean:
rm -rf *.o

abcdebug:
make CC='$(CC) -D_DEBUG'

abcrelease:
make CC='$(CC)'

Apologies for any incoherance in the above post. This is something I've been working on for a couple of months now, clawing from "hunk of code that compiles on Windows" towards something I can develop on my mac. It's been hard to group and indeed identify all of the issues and possible causes, and I think that I'm almost there.
Quote this message in a reply
dair
Unregistered
 
Post: #3
Can you compare the build transcript from Xcode to the commands your makefile is emitting? That's probably going to be the quickest way to find the difference.

By default the Build Status window hides the transcript from you and attempts to summarise progress/errors - to see the underlying gcc/ld invocations and errors, click the little 'paragraph' icon down in the bottom left of the Build Status window (the one to the right of the yellow alert icon).
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  SDL Project Stationary for Xcode Evan Stallings 11 3,369 Jul 9, 2013 05:17 PM
Last Post: Evan Stallings
  Compiling existing C++ code in my iOS project olafure 1 4,244 Apr 13, 2012 10:28 AM
Last Post: szymczyk
  Why won't Xcode even try compiling my .cpp files?? SparkyNZ 11 13,387 Apr 3, 2011 01:44 PM
Last Post: AnotherJake
  Converting unix SDL project to xcode Dominus 0 4,082 Jan 3, 2011 04:46 AM
Last Post: Dominus
  Debugging in XCode without project? mattz 5 5,685 Dec 5, 2009 01:21 PM
Last Post: bronxbomber92