LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-05-2021, 04:08 PM   #1
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Rep: Reputation: 51
why there is no man page for gcc and g++, and their help does is incomplete?


I am in Debian, gcc is installed normally, some other things for development are installed too, but "man gcc" and "man g++" give errors! Why?

Further, asking their help in the command line does not help much (!!). For example, 'g++ --help' gives only this output:

Quote:
Usage: g++ [options] file...
Options:
-pass-exit-codes Exit with highest error code from a phase.
--help Display this information.
--target-help Display target specific command line options.
--help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].
Display specific types of command line options.
(Use '-v --help' to display command line options of sub-processes).
--version Display compiler version information.
-dumpspecs Display all of the built in spec strings.
-dumpversion Display the version of the compiler.
-dumpmachine Display the compiler's target processor.
-print-search-dirs Display the directories in the compiler's search path.
-print-libgcc-file-name Display the name of the compiler's companion library.
-print-file-name=<lib> Display the full path to library <lib>.
-print-prog-name=<prog> Display the full path to compiler component <prog>.
-print-multiarch Display the target's normalized GNU triplet, used as
a component in the library path.
-print-multi-directory Display the root directory for versions of libgcc.
-print-multi-lib Display the mapping between command line options and
multiple library search directories.
-print-multi-os-directory Display the relative path to OS libraries.
-print-sysroot Display the target libraries directory.
-print-sysroot-headers-suffix Display the sysroot suffix used to find headers.
-Wa,<options> Pass comma-separated <options> on to the assembler.
-Wp,<options> Pass comma-separated <options> on to the preprocessor.
-Wl,<options> Pass comma-separated <options> on to the linker.
-Xassembler <arg> Pass <arg> on to the assembler.
-Xpreprocessor <arg> Pass <arg> on to the preprocessor.
-Xlinker <arg> Pass <arg> on to the linker.
-save-temps Do not delete intermediate files.
-save-temps=<arg> Do not delete intermediate files.
-no-canonical-prefixes Do not canonicalize paths when building relative
prefixes to other gcc components.
-pipe Use pipes rather than intermediate files.
-time Time the execution of each subprocess.
-specs=<file> Override built-in specs with the contents of <file>.
-std=<standard> Assume that the input sources are for <standard>.
--sysroot=<directory> Use <directory> as the root directory for headers
and libraries.
-B <directory> Add <directory> to the compiler's search paths.
-v Display the programs invoked by the compiler.
-### Like -v but options quoted and commands not executed.
-E Preprocess only; do not compile, assemble or link.
-S Compile only; do not assemble or link.
-c Compile and assemble, but do not link.
-o <file> Place the output into <file>.
-pie Create a position independent executable.
-shared Create a shared library.
-x <language> Specify the language of the following input files.
Permissible languages include: c c++ assembler none
'none' means revert to the default behavior of
guessing the language based on the file's extension.

Options starting with -g, -f, -m, -O, -W, or --param are automatically
passed on to the various sub-processes invoked by g++. In order to pass
other options on to these processes the -W<letter> options must be used.

For bug reporting instructions, please see:
<file:///usr/share/doc/gcc-6/README.Bugs>.
In this "help" output, there is nothing about "-l", for example, something basic that was useful to me, in the last threads i started here. "-l" is not in the 'gcc --help' either (both are similar, actually).
 
Old 02-05-2021, 04:24 PM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,678

Rep: Reputation: Disabled
See this thread.
 
3 members found this post helpful.
Old 02-05-2021, 04:34 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,269
Blog Entries: 24

Rep: Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206Reputation: 4206
I cannot say why those man pages give errors (not a Debian user), but perhaps if you post what the errors are we may help. Guess: broken or incomplete install?

One reason -l does not appear in gcc --help is because it is not a gcc option, it is a linker option. Try ld --help;

Code:
 ld --help
Usage: ld [options] file...
Options:
  ...
  -l LIBNAME, --library LIBNAME
                              Search for library LIBNAME
There are so many options and variations for gcc/g++ I doubt that they are all listed in --help output, but the man pages and info pages will lead to the complete set available.

You can receive further, more specific help like this (from the g++ --help output you posted):

Code:
--help={common|optimizers|params|target|warnings|[^]{joined|separate|undocumented}}[,...].
Display specific types of command line options.
(Use '-v --help' to display command line options of sub-processes).
Learning what compiler options are available and how to use them, and how and when the linker is invoked, and when it is not, and what options it requires... is complex and will really mostly take time and experience.

Good place to start here.

Last edited by astrogeek; 02-05-2021 at 04:49 PM.
 
1 members found this post helpful.
Old 02-05-2021, 05:08 PM   #4
Creed College
LQ Newbie
 
Registered: Dec 2019
Location: Village of Hempstead, New York
Distribution: Debian, Fedora, Linux Mint and Slackware
Posts: 4
Blog Entries: 8

Rep: Reputation: Disabled
Arrow The Light

The following links may be helpful.

https://man7.org/linux/man-pages/dir...lphabetic.html

https://man7.org/linux/man-pages/man1/gcc.1.html

https://man7.org/linux/man-pages/man1/g++.1.html

https://man7.org/linux/man-pages/index.html

Peace.
- George
 
1 members found this post helpful.
Old 02-05-2021, 05:24 PM   #5
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Talking

Very nice! Thank you! The last address is in my favorites now. (:
 
Old 02-05-2021, 05:26 PM   #6
dedec0
Senior Member
 
Registered: May 2007
Posts: 1,372

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by astrogeek View Post
I cannot say why those man pages give errors (not a Debian user), [...]
Sorry. Maybe the way i chose to write is bad. I meant to say the man pages for gcc and g++ do not exist - just this is what the 'man' command error says.
 
1 members found this post helpful.
Old 02-05-2021, 05:55 PM   #7
Creed College
LQ Newbie
 
Registered: Dec 2019
Location: Village of Hempstead, New York
Distribution: Debian, Fedora, Linux Mint and Slackware
Posts: 4
Blog Entries: 8

Rep: Reputation: Disabled
Quote:
Originally Posted by dedec0 View Post
Very nice! Thank you! The last address is in my favorites now. (:
You are very welcome.
Peace.
 
Old 02-05-2021, 10:41 PM   #8
NevemTeve
Senior Member
 
Registered: Oct 2011
Location: Budapest
Distribution: Debian/GNU/Linux, AIX
Posts: 4,879
Blog Entries: 1

Rep: Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871Reputation: 1871
Try this as root-user:
Code:
apt-get install gcc-doc
 
Old 02-06-2021, 06:40 AM   #9
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,678

Rep: Reputation: Disabled
@NevemTeve. This alone may be not enough. See the thread linked in #2.
 
1 members found this post helpful.
  


Reply

Tags
g++, g++ help, gcc, gcc help, man page



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
table of common inkjet printers and their page yield or cost per page Turbocapitalist Linux - Hardware 11 09-13-2017 11:54 AM
man page is not found although $MANPATH and man.conf changed Abbraxas Linux - Newbie 3 09-05-2011 06:40 PM
is there any manual entry for gcc other than man gcc akhand_jyoti Linux - Newbie 2 01-16-2010 02:13 AM
man alsamixer not showing the man page nosaku Slackware 1 12-20-2004 08:52 AM
Is there a man page on how to use man page? jdruin Linux - Software 2 10-30-2004 09:29 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration