2

I am finding it hard to run/compile a simple C++ code in the terminal. Here's the code I am using to compile the file (helloworld.cpp).

g++ helloworld.cpp -o helloworld

I am getting an error. (Image)

g++: fatal error: no input files

0

1 Answer 1

6

You need to have the code file (in this case helloworld.cpp) in your current working directory. If the code file is in a different directory, you need to specify where in the command. For example

g++ some/other/folder/helloworld.cpp -o helloworld.o

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .