question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GCC not recognized anymore

See original GitHub issue
  • OS: GNU/Linux (5.11.16-arch1-1 #1 SMP PREEMPT Wed, 21 Apr 2021 17:22:13 +0000 x86_64 GNU/Linux)
  • VS Code: 1.55.2
  • CMakeTools: 1.7.0
  • Installed compilers: gcc 10.2.0, clang 11.1.0

Since yesterday, when I scanned available Kits, GCC dropped out of the list. Setting cmake.loggingLevel to debug permitted me to see GCC is not recognized (sorry output is in french):

[kit] Bad GCC binary "/usr/bin/gcc -v" version:10.2.0 output: Utilisation des specs internes.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/lto-wrapper
Cible : x86_64-pc-linux-gnu
Configuré avec: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl --with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit --enable-cet=auto --enable-checking=release --enable-clocale=gnu --enable-default-pie --enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id --enable-lto --enable-multilib --enable-plugin --enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch --disable-libunwind-exceptions --disable-werror gdc_include_dir=/usr/include/dlang/gdc
Modèle de thread: posix
Algorithmes de compression LTO supportés: zlib zstd
gcc version 10.2.0 (GCC) 

After reading issue #1575, I checked the extension code and actual gcc output and found the failure here: https://github.com/microsoft/vscode-cmake-tools/blob/d5fa7327a0ecde7dfb86c96263d089c04cfb24b0/src/kit.ts#L156

gcc help (man gcc) explains -v is not used to get the version (although it is in the output) but information:

-v        Print (on standard error output) the commands executed to run the stages of
           compilation.  Also print the version number of the compiler driver program
           and of the preprocessor and the compiler proper.

The real flag to ask for version is --version:

 --version
           Display the version number and copyrights of the invoked GCC.

An actually using this flag returns what the extension is expecting:

$ gcc --version
gcc (GCC) 10.2.0
Copyright © 2020 Free Software Foundation, Inc.
Ce logiciel est un logiciel libre; voir les sources pour les conditions de copie.  Il n'y a
AUCUNE GARANTIE, pas même pour la COMMERCIALISATION ni L'ADÉQUATION À UNE TÂCHE PARTICULIÈRE.

I suggest that maybe you add the flag to put in the command to the getCompilerVersion() function, or systematically use --version (which works for most programs).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
andreeiscommented, May 4, 2021

@riri, if you would like, you can try this vsix (https://github.com/microsoft/vscode-cmake-tools/actions/runs/811030625) to get unblocked with a fix for this issue before we release 1.7.2.

1reaction
bobbrowcommented, May 4, 2021

If you are blocked by that other bug, you should be able to manually edit your kits JSON file with the “Edit user-local Kits” command. Just fix the compiler in there and don’t scan for kits again. 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Solved] gcc is not recognized as an internal or external ...
The first thing you need to check is whether you have installed the gcc compiler or not. If you have not installed gcc...
Read more >
GCC is not recognized as internal or external command
GCC is not recognized as internal or external command · The first step is to check what all you have in your PATH...
Read more >
1689 (Space in working directory makes gcc not reachable)
On windows,. after installing 1.8.1,. buildModel and simulate does not work anymore after moving to a directory containing space (using cd command).
Read more >
Cygwin FAQ
Why is my .rhosts file not recognized by rlogin anymore after updating to Cygwin 1.7.34? 4.41. ... Can I mix objects compiled with...
Read more >
Using GCC Compilers - Springer Link
When you invoke any GCC compiler to compile a source code file, ... GCC compilers assume that any file that does not end...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found