Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I have never used make before and I would like to compile my c++ program I wrote on my ubuntu 12.04 machine on a red hat server. I copied ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2012
    Posts
    1

    using make to compile cpp program written with eclipse on ubuntu


    Hi, I have never used make before and I would like to compile my c++ program I wrote on my ubuntu 12.04 machine on a red hat server. I copied the whole Debug folder to the red hat machine. And ran make but I get this error:

    make: Nothing to be done for `src/main.d'.

    It is a simple program with a main and one other class.

    How could I get the program to compile on the red hat server?

    Thanks!

  2. #2
    Just Joined!
    Join Date
    Aug 2011
    Posts
    18
    I'm not a cpp expert by any means, but the way "make" works to compile code is by looking for a 'Makefile' in the working directory, and then build the program as specified in the Makefile. You likely don't have a Makefile yet, which is why you can't use make to build your program yet.

    To compile the source code without an IDE such as eclipse, you might be able to get away with a simple command like, [inline]$ g++ main.c[/inline] if your code really is that simple. Otherwise, you should look at some Makefile tutorials and then ask more specific questions once you have a good start worked out. I don't quite have enough posts racked up yet in order to post URLs but googling for 'makefile cpp' yeilded what I think looks like a solid introduction to Makefiles.

    I think your best bet is to come up with a way to use g++ to comile your code by hand, and then stuff it into a Makefile.

  3. #3
    Just Joined!
    Join Date
    Mar 2007
    Location
    Bogotá, Colombia
    Posts
    43
    You should take a look to the GNU tools for building makefiles.

    Autoconf - GNU Project - Free Software Foundation (FSF)
    Automake - GNU Project - Free Software Foundation (FSF)

    It was really helpful the first time I played a little with Makefiles.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •