Tuesday, May 7, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 3956  / 2 Years ago, sun, october 30, 2022, 2:51:44

I wanted to use g++. However, when I type in g++ in the terminal, it says, "fatal error no input files". I have asked a similar question before but to avoid extending the discussion in the comments, i have asked this solely for g++. I would also like to know the type of files that are compiled .i.e the nature of the file.


More From » command-line

 Answers
1

In Ubuntu you can append --help onto most commands to see more information about how to run them. In this case:



$ g++ --help
Usage: g++ [options] file...
Options:
....


You can also look at man g++ which will tell you lots more but here's the synopsis:



SYNOPSIS
gcc [-c|-S|-E] [-std=standard]
[-g] [-pg] [-Olevel]
[-Wwarn...] [-Wpedantic]
[-Idir...] [-Ldir...]
[-Dmacro[=defn]...] [-Umacro]
[-foption...] [-mmachine-option...]
[-o outfile] [@file] infile...


The short of it is you need to provide a filename to your source file. Eg:



g++ test.cpp

[#23073] Monday, October 31, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
velelf

Total Points: 395
Total Questions: 115
Total Answers: 107

Location: Sudan
Member since Mon, Jun 1, 2020
4 Years ago
velelf questions
Sat, Nov 6, 21, 05:08, 3 Years ago
Fri, Sep 24, 21, 01:23, 3 Years ago
Sun, Oct 9, 22, 07:37, 2 Years ago
Mon, Oct 10, 22, 08:55, 2 Years ago
;