#Strange behavior of compiler version?!

34 messages ยท Page 1 of 1 (latest)

jaunty hearth
#

The program outputs the g++ version of 14.2.0, but the terminal tells me 13.2.0? Why is it different? ๐Ÿค”

vestal marshBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

unborn tinsel
#

You have multiple different compilers installed

jaunty hearth
unborn tinsel
#

That's the issue with IDEs, they do their own magic. Who knows how it selects the compiler

#

Delete one of them perhaps

jaunty hearth
#

I guess that's the only option I have

#

@unborn tinsel Also another question: Where (path) did you install your GCC compiler? Is there some kind of structure you should have when installing compilers or something else?

unborn tinsel
#

I'm not even on Windows anymore ๐Ÿ˜›

#

Do you know what PATH is?

jaunty hearth
unborn tinsel
#

That's a path, but there's "the" PATH ๐Ÿ˜›

#

It's a system setting, a list of paths

#

When you run an exe without specifying an absolute path, such as g++, it gets searched for in the PATH

#

So this means you have GCC 13 added to the PATH, and either don't have GCC 14 added at all, or it's added after GCC 13

jaunty hearth
unborn tinsel
#

Well it seems otherwise

#

Run echo $env:PATH in the terminal, show what it prints

jaunty hearth
# unborn tinsel Run `echo $env:PATH` in the terminal, show what it prints
  • C:\Program Files\PowerShell\7
  • C:\Program Files\Python312\Scripts\
  • C:\Program Files\Python312\
  • C:\Program Files\Eclipse Adoptium\jdk-21.0.6.7-hotspot\bin
  • C:\Program Files\Python311\Scripts\
  • C:\Program Files\Python311\
  • C:\WINDOWS\system32
  • C:\WINDOWS
  • C:\WINDOWS\System32\Wbem
  • C:\WINDOWS\System32\WindowsPowerShell\v1.0\
  • C:\WINDOWS\System32\OpenSSH\
  • C:\Program Files\Java\jdk-21\bin
  • C:\Program Files\TortoiseSVN\bin
  • C:\Program Files\Git\cmd
  • C:\Program Files\PowerShell\7\
  • C:\Program Files\Docker\Docker\resources\bin
  • C:\mingw64\bin
  • C:\Program Files\MySQL\MySQL Shell 8.0\bin\
  • C:\Users\dagli\AppData\Local\Microsoft\WindowsApps
  • C:\Program Files\JetBrains\IntelliJ IDEA 2023.2.2\bin
  • C:\Program Files\JetBrains\CLion 2023.2.2\bin
  • C:\Users\dagli\AppData\Local\Programs\Microsoft VS Code\bin
  • C:\Users\dagli\AppData\Local\Programs\oh-my-posh\bin
  • C:\Program Files\JetBrains\PyCharm 2023.3\bin
  • C:\Users\dagli\AppData\Local\JetBrains\Toolbox\scripts
  • C:\Users\dagli\AppData\Local\Microsoft\WindowsApps
  • C:\mingw64\bin
unborn tinsel
#

And run gcm g++ too, it should show you where it found this command

jaunty hearth
unborn tinsel
#

That should be your gcc 13

daring river
#

you can manually change it in toolchain settings

unborn tinsel
daring river
#

eg.

#

you can either select it or use whatever it detects

#

im guessing it just uses PATH to detect the compiler

unborn tinsel
daring river
#

or maybe CLion goes trough all of them and selects the latest one?

unborn tinsel
#

๐Ÿคทโ€โ™‚๏ธ