-3

run eclipse che by browser in ubuntu when i run this code

#include <iostream>

main() {
    std::cout << "Hello World!";
    return 0; }

i got this error

cd /projects/my_prj && make && ./a.out

make: *** No targets specified and no makefile found. Stop.

what can i do for solve it?

enter image description here

fariborz najafi
  • 69
  • 1
  • 2
  • 8

1 Answers1

0

To test that the required tooling is installed, try running this in the terminal:

cd /projects/my_prj
g++ -o a.out main.cc

(or whatever you called the C++ file you wrote above).

If you want a Makefile to build the project, you will need to specify a target (the default target will be "all") which has a rule for compiling the C++ code into a binary. The minimum would be something like this:

all:
     g++ main.cc

Put this in a file called Makefile, and make sure that the 2nd line starts with a real tab, not an expanded one, and you should be good. There is a lot more to learn about Makefiles, but this will get you started.

Dave Neary
  • 297
  • 1
  • 4