C++ compilation with ProjectBuilder

macOSXguy

Registered
I have a fairly large program I have been developing in UNIX via text editors and a makefile. It compiles just fine in OS X via the command line, but I cannot seem to figure out how to import and build the program using ProjectBuilder. I do not have any GUI routines, nor do I plan to implement one. It would be nice to have a clickable executable, instead of executing the app from the command line though.

My current attemps to import consist of:
1) New "Empty Project"
2) Create a new "target"
3) add files (*.cpp and *.h) and assign them to target
4) hit build

Looks like it does some compilation, then stops with an error due to "undefined symbols:" and "warning prebinding disabled because of undefined symbols".

My questions start at: what type of Project should I start with (Cocoa, Carbon, C++ Tool)? What are the *.m files? Is this necessary for a C++ application? If I click on the "Classes" tab, there seems to be a lot of classes in there that are not mine. Do I need these?

Is it just me or is PBuilder confusing? I compiled the same program for the PC using MS VisualC++.net application and that was pretty easy. Seems like there is a lot of extra stuff included that I do not need.

Thanks!

John
 
.m files = objective-c files (not necessary for a C++ project)

to make a clickable executable u need to, compile and add a resource fork to your file this can be done using apple's "Rez" tool (Developer/Tools/Rez),

man Rez

for more details


BTW: your project is a C++ Tool (since ur not using any carbon stuff [apple's api] in your files)

ALSO NOTE: look down, after clicking on the classes tab, then select from the drop-down list (hierarchy, project class) then u'll see only your classes, in the list

MORE NOTES: if it dosen't link it's probably because you haven't added the necessary libraries/frameworks/bundles you're using, into the project
(try adding libstdc++ library to ur project)
 
For a quick start you can choose the "Legacy Makefile" project type, let it refer to your Makefile and add all your source and header files. This should work, you should even be able to use the debugger.
 
Back
Top