How to compile multi file C++ code on mac

Discussion in 'Mac Programming' started by kbboy, Jun 14, 2007.

  1. kbboy macrumors newbie

    Joined:
    Jun 14, 2007
    #1
    Hi,

    I am new to this forum and Mac too. In fact i have always used windows only throughout life.

    OK, i have a code i downloaded. It has a bunch of .H and .CC files and also a makefile. Can someone please tell me how to compile and run the code on mac. Please remember that i am new to mac, so some specific terminologies might not be known to me.

    thanks.
     
  2. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #2
    You need to download an install the latest version of XCode from the http://developer.apple.com. Sign up (it's free), and download and install.
     
  3. kbboy thread starter macrumors newbie

    Joined:
    Jun 14, 2007
    #3
    thanks for the help.

    Actually there's another problem, the Mac is a server computer and i am remotely connected to it via vnc. I dont have admin rights :(

    How can i find if it already installed or not or any other method say using g++? Its a server lots of people connect to when they have to run heavy programs( requiring huge memory) so i guess it might contain some compilers already just that i dont know how to find out.

    thanks again for the quick reply;
     
  4. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #4
    No admin rights, therefore no installation of XCode (and GCC), and therefore, no ability to compile. Sorry!
     
  5. kbboy thread starter macrumors newbie

    Joined:
    Jun 14, 2007
    #5
    g++ and GCC are different?

    I have been able to run a single file code using g++. Only that i dont know how to run a multi file code using g++.
     
  6. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #6
    No, they are the same thing.

    Duh.. that's right, you said this was OS X Server, which I believe comes with the XCode tool installed by default.

    In this case, the code that you downloaded should have a make file with it, yes?
     
  7. Krevnik macrumors 68040

    Krevnik

    Joined:
    Sep 8, 2003
    #7
    Here is a silly idea: From a terminal window, go to the directory these files are in, and run the command 'make'. See how that goes.

    If it doesn't work, then the Makefile probably needs to be updated a bit, which might be complicated.
     
  8. kbboy thread starter macrumors newbie

    Joined:
    Jun 14, 2007
    #8
    yes it does..
     

Share This Page