1

I am working with Ubuntu 19.04 (Disco Dingo), and I have GCC installed.

When I run

gcc

I am getting an error showing that I do have gcc:

gcc: fatal error: no input files compilation terminated.

When I am running gcc with arguments like this

gcc‬‬ ‫‪-g‬‬ ‫‪-m32‬‬ ‫‪-o‬‬ ‫‪skip‬‬ ‫‪skip.c‬‬

I am getting

gcc‬‬: command not found

I've ran

apt-get purge gcc
apt-get install build-essential

And still I am getting the same error.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
thebeancounter
  • 4,261
  • 8
  • 61
  • 109
  • @usr installing build-essentials installs gcc, I specifically write that just gcc is working, please read the OP – thebeancounter May 11 '20 at 10:07
  • regarding: `apt-get purge gcc` and `apt-get install build-essential` Unless you running as `root`, (which is a very bad idea) these command will not work. Suggest using the `sudo` command prefixed to each of those commands. Note: the first thing that will happen is the `sudo` will request your password. – user3629249 May 12 '20 at 15:46
  • suggest, at a command prompt, running: `set | more` to see if there is some environment variable that is messing up the usage of the `gcc` command – user3629249 May 12 '20 at 16:05
  • A more direct analysis of the problem with the invisible characters is (e.g., from the output of `hexdump -e '"%08.8_ax " 8/1 "%02X " " " 8/1 "%02X " " |"' -e '16/1 "%_p""|\n"' '/home/mortensen/temp2/2022-05-08/Broken GCC characters.txt'`), 0xE2 0x80 0xAC (hexadecimal), reveals UTF-8 sequence for Unicode code point U+200C ([POP DIRECTIONAL FORMATTING](https://www.utf8-chartable.de/unicode-utf8-table.pl?start=8704&number=128)). Similarly, there are also RIGHT-TO-LEFT EMBEDDING (U+202B) and LEFT-TO-RIGHT EMBEDDING (U+202A) in there. – Peter Mortensen May 08 '22 at 12:51
  • Instead of cumbersome analysis, the most common ones can be searched for in a reasonable modern text editor in ***regular expression mode*** with `\x{00A0}|\x{200B}|\x{200C}|\x{2013}|\x{2014}|\x{201C}|\x{201D}|\x{2212}|\x{00E4}|\x{FFFD}|\x{2217}|\x{200C}|\x{202B}|\x{202A}`. Using search-replace, even the ***invisible*** ones can be fixed (deleted or replaced with space)—there isn't any need to retype anything. The check could even be added to compilation, make, or [automatic build system](https://en.wikipedia.org/wiki/Continuous_integration#Deploy_an_artefact_from_CI) steps. – Peter Mortensen May 08 '22 at 13:04
  • The underlying reason for this problem is copy-paste of ***formatted text***, e.g., from web sites (like [blogposts](https://en.wiktionary.org/wiki/blogpost#Noun)), [PDF](https://en.wikipedia.org/wiki/Portable_Document_Format) documents, or chat sessions (e.g., [Skype Chat](https://en.wikipedia.org/wiki/Features_of_Skype#Skype_chat)). Related Stack Overflow question (canonical): *[Compilation error: stray ‘\302’ in program, etc](https://stackoverflow.com/questions/19198332)* – Peter Mortensen May 08 '22 at 13:11
  • This can't be the first question of this nature (invisible Unicode characters messing up command-line invocations). Where is the *canonical* question? Here is [one from 2018](https://stackoverflow.com/questions/52322629/having-an-issue-with-ssh-t-gitgithub-com), but there *must* be some much older ones. One way to find candidates is to search for the octal sequences (often part of error messages), e.g. "`site:stackoverflow.com 342 200 213`". Sometimes the numbers are in hexadecimal (E2 80 8B) or decimal (226 128 139). – Peter Mortensen May 08 '22 at 13:30

1 Answers1

1

Your line

gcc‬‬ ‫‪-g‬‬ ‫‪-m32‬‬ ‫‪-o‬‬ ‫‪skip‬‬ ‫‪skip.c

is ASCII broken. There are strange (invisible) characters before the spaces. Check it here.

Also, to run gcc with -m32 flag on, you need to install gcc-multilib first:

apt-get install gcc-multilib
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
David Ranieri
  • 39,972
  • 7
  • 52
  • 94