PDA

View Full Version : Nehe Tutorial Projects (Newbie Question)



toneburst
12-03-2007, 07:04 AM
Hi,

I'd really like to have a go at some of the tutorials on the Nehe Productions site

http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=02

as they all look really interesting. Unfortunately, it looks like the Cocoa XCode projects very kindly converted by Bryan Blackburn no longer compile on more recent MacOS versions (I'm currently using 10.5.1 on a MacBook Pro).

I wonder if anyone could possibly give me some hints on getting the code to work under OS X 10.4 or 10.5? I get a number of errors with the projects I've tried to compile.
The first one is an error for the
#import <Cocoa/Cocoa.h>
line in main.m. Apparently, this library can't be found. I'm not sure why this should be the case, as the import command for the same library in projects I am able successfully to compile looks identical. Any ideas? I think other errors may be related to the failure to load the Cocoa library.

I'm a complete beginner when it comes to XCode and Cocoa I'm afraid, though I have done bits and pieces of coding and scripting in a number of different languages over the years. I'd love to learn a little about OpenGL on the Mac, and these tutorials seem an ideal starting-point.

Cheers


Regards,

Alex Drinkwater
Quartz Composer realtime effects blog: http://machinesdontcare.wordpress.com
Music site: http://www.toneburst.net

k_szczech
12-03-2007, 10:10 AM
If one project can find Cocoa.h and other cannot, then you should check what your include path is set to in both projects.

If include path settings will not solve this problem, then you should check if the other project (that you can compile) does not include Cocoa library somewhere in it's folder.

toneburst
12-03-2007, 10:32 AM
Aha!
That sounds like a good plan. I'm sure the locations of things have changed since the early days of MacOS X. I have a feeling some of those Nehe tutorials are quiiiiite old now.

I will try to find out how to check the include path.

Thanks,

alx

toneburst
12-03-2007, 01:17 PM
Any pointers on how I might correct the include path?
I've tried right-clicking the libraries in the project view panel, and choosing the appropriate frameworks in /System/Library/Frameworks, but I still get the same error.

Thanks again,

alx

k_szczech
12-04-2007, 08:10 AM
No idea. I use Visual Studio 2003 and it's in the project properties screen.

Keep in mind that you must have proper path for compiler and for linker. Maybe you were looking in the linker options instead of compiler options?
On Windows, compiler must find all the .h source files and linker must find all the .lib binary files.

toneburst
12-04-2007, 11:29 AM
Cheers for the advice.

I've actually been in touch with the guy who translated the files for the Mac in the 1st place. Apparently, they're REALLY old, and there may be a number of bugs preventing them working under OS X 10.5, so I think I'll give up on them for the moment, and take a look at some of the Developer examples, to see what I can learn from those.

Thanks again guys,

alx

OneSadCookie
12-05-2007, 03:33 AM
The GLUT ports were always much better than the Cocoa ones anyway. They shouldn't be too difficult to get working in Xcode.

toneburst
12-05-2007, 04:02 AM
Ah, thanks for that.
I may try the GLUT ones, in that case..

Cheers,

alx