Getting an exectable with Project Builder (OS 10.2)

Hi, I’m new to working with OpenGL and am working on the Mac. I am using Project Builder to develop my files, and am able to build and run them. However, I do not seem to be exporting a runable file. I am building my projects as a C++ tool.

I posted in the beginner forum and got some helpful suggestions - but I am hoping this forum might have some other suggestions.

Does anyone use Project Builder and know how to export an executable similar to the exe files you get from Code Warrior on the PC?
Thanks!

A C++ tool is a unix command-line tool. It can’t be run from the Finder on Mac OS X 10.2 (sort of can on 10.3).

If you want to make something that can be double-clicked from the Finder, you need to have a “bundle”, which is made by one of the “Application” targets.

Thanks. I’ll check into that. Would that be the carbon or cocoa bundles or one of the application types.

Try Cocoa Application. That will give you a hello world-type project which will produce a blank window.

Now at this point you have to decide what GL interface to use on the Mac. You could learn NSGL (NSOpenGLContext etc) but this will require some time with Obj-C, IB, etc.

Another option is GLUT, you can throw away the NSApp stuff in the Cocoa main() and replace it with a plain C style main that creates a window using GLUT. The result is just like a GLUT C++tool, except that the executable is wrapped in a bundle.
See http://homepage.mac.com/arekkusu/SW/ParallaxBumpMapping_source.dmg for an example of this (xcode project so you’ll need 10.3 to open it but you can still look at the main() in 10.2.)

Or you could do it in Carbon with AGL. Which way you go depends what you’re porting from and how much time you have to learn the Mac-specific bits.

Hi Arekkusu,
Thanks! I’ve been working with GLUT so I will try that. I tried it as a bundle and it doesn’t work - will try app. Best, TS

You could try here: http://onesadcookie.is-a-geek.net/~keith/XcodeGLUT . It’s for Xcode rather than Project Builder, but most things should be the same.

Hi folks, thank you for the replies. I am now able to create executable files.

However, I’m working on a new project (using Glut, fast Fourier Transformation, and a few aiff files) that I am adapting from code that was working on the PC. I have made the standard changes to transform it to a Project Builder file (e.g. changing gl/glut.h to GLUT/glut.h).

However I receive the following message when I try to build and run it. Basically, it gets most of the way there and then something stops it. Do you have any suggestions?

Cp /Users/turi/Documents/parsons/Courses/semester2-sp04/avsys/main-code/FFTmic1/build/FFTmic1.app/Contents/PkgInfo
BuildPhase <CopyResources>FFTmic1.app
Completed phase <CopyResources> for <CopyResources>FFTmic1.app
BuildPhase <DeriveAndCompileSources>FFTmic1.app
Completed phase <DeriveAndCompileSources> for <DeriveAndCompileSources>FFTmic1.app
StandaloneExecutable /Users/turi/Documents/parsons/Courses/semester2-sp04/avsys/main-code/FFTmic1/build/FFTmic1.app/Contents/MacOS/FFTmic1
ld: warning prebinding disabled because of undefined symbols
ld: Undefined symbols:
mAiffReadData(char*, float*, unsigned long, long)

/usr/bin/g++3  -o "/Users/turi/Documents/parsons/Courses/semester2-sp04/avsys/main-code/FFTmic1/build/FFTmic1.app/Contents/MacOS/FFTmic1"  "-L/Users/turi/Documents/parsons/Courses/semester2-sp04/avsys/main-code/FFTmic1/build"  "-F/Users/turi/Documents/parsons/Courses/semester2-sp04/avsys/main-code/FFTmic1/build"  -filelist "/Users/turi/Documents/parsons/Courses/semester2-sp04/avsys/main-code/FFTmic1/build/FFTmic1.build/FFTmic1.build/Objects-normal/LinkFileList"  "-arch" "ppc" "-prebind"   "-framework" "Carbon" "-lstdc++" "-framework" "AppKit" "-framework" "AudioToolbox" "-framework" "CoreAudio" "-framework" "Foundation" "-framework" "GLUT" "-framework" "OpenGL" "-framework" "Cocoa" 

…failed StandaloneExecutable.LinkUsingFileList /Users/turi/Documents/parsons/Courses/semester2-sp04/avsys/main-code/FFTmic1/build/FFTmic1.app/Contents/MacOS/FFTmic1 …

I’m assuming that mAiffReadData is one of your own functions, given that it’s a C++ function…

You’ll need to add whatever source file defines it to the project.

i’ve made a tutorial for those converting code that was developed on a pc for a mac:

http://a.parsons.edu/~algo/students/jacqueline/codewarrior_tut.htm

it might be a bit of a hassle but it works.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.