undefined symbols

Discussion in 'Mac Programming' started by zeppenwolf, Jan 16, 2011.

  1. zeppenwolf macrumors regular

    zeppenwolf

    Joined:
    Nov 17, 2009
    #1
    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.
     
  2. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    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.

    Your first born :)
     
  3. zeppenwolf thread starter macrumors regular

    zeppenwolf

    Joined:
    Nov 17, 2009
    #3
    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!

    So, if I give up my first the compiler will be nice? If I can get some visitation rights, IT'S A DEAL.
     

Share This Page