Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zeppenwolf

macrumors regular
Original poster
Nov 17, 2009
129
3
I'm porting a classic app to carbon. After all the struct accessor to function calls business, I get an error message about undefined symbols, (about thirty of them!) when it's time to link.

The project mixes C and C++, but here's the thing. As an example,

Code:
#ifdef __cplusplus
    extern "C" {
#endif

void HandleMenuChoice( short item );

#ifdef __cplusplus
    }
#endif

is declared in a header file. It's defined only once, in a C file, (other examples are compiled in C++ files) It's called only once, in another C file. Both files are included in the project; both the defining file and the calling file include the declaring header.

Honestly, what the heck does the compiler want from me?

This is with PB 2.1 on OS X.2.8 I just want to get this thing carbonated enough to use as a reference build, which I can run on X.4, while building a Cocoa equivalent. I hope that all makes sense; if it doesn't I blame white zinfandel.
 
Make sure you're actually compiling the file. Just because it's listed inside PB doesn't mean it's compiling. You should see it under the target in Compile Sources.

Honestly, what the heck does the compiler want from me?
Your first born :)
 
Ok, a slew of my files were being treated as resources. Heh. Some C files, but not all; some C++ files, but not all, were just being copied as though they were, well, resources. How the heck I got there, I don't have a clue, but problem solved. Thx, kainjow, for pointing out the obvious... which is what I needed!

Your first born :)

So, if I give up my first the compiler will be nice? If I can get some visitation rights, IT'S A DEAL.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.