XCode project build options + makefiles = compiling fun!
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
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
Actually, an an afterthought, here's the makefile in question:
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: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.
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).
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).
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| Compiling existing C++ code in my iOS project | olafure | 1 | 3,125 |
Apr 13, 2012 10:28 AM Last Post: szymczyk |
|
| Why won't Xcode even try compiling my .cpp files?? | SparkyNZ | 11 | 11,045 |
Apr 3, 2011 01:44 PM Last Post: AnotherJake |
|
| Converting unix SDL project to xcode | Dominus | 0 | 3,456 |
Jan 3, 2011 04:46 AM Last Post: Dominus |
|
| Debugging in XCode without project? | mattz | 5 | 4,681 |
Dec 5, 2009 01:21 PM Last Post: bronxbomber92 |
|
| xcode build optimizations | NelsonMandella | 5 | 5,459 |
Jul 24, 2009 06:39 AM Last Post: Oddity007 |
|

