Author Topic: g++.exe what -std=c++ <what version>  (Read 5827 times)

Offline jmClifford

  • Multiple posting newcomer
  • *
  • Posts: 13
g++.exe what -std=c++ <what version>
« on: April 22, 2024, 05:08:13 pm »
Hi. I understand that I have installed a compiler package in a folder MinGW.
If I do not specify in CB what to use, then how can I determine what has been used
(wrt C++ standard) ??

A sample of the built log follows;


Quote
-------------- Clean: Debug in ThreadNames (compiler: GNU GCC Compiler)---------------

Cleaned "ThreadNames - Debug"

-------------- Build: Debug in ThreadNames (compiler: GNU GCC Compiler)---------------

g++.exe -Wall -fexceptions -g -IC:\WxWidgetsSetup\include -IC:\WxWidgetsSetup\lib\gcc_dll -c C:\u\CodeBlock_C++\EasyLoggingpp_ThreadNames\ThreadNames\easylogging++.cc -o obj\Debug\easylogging++.o
g++.exe -Wall -fexceptions -g -IC:\WxWidgetsSetup\include -IC:\WxWidgetsSetup\lib\gcc_dll -c C:\u\CodeBlock_C++\EasyLoggingpp_ThreadNames\ThreadNames\main.cpp -o obj\Debug\main.o
g++.exe  -o bin\Debug\ThreadNames.exe obj\Debug\easylogging++.o obj\Debug\main.o   C:\WxWidgetsSetup\lib\gcc_dll\libwxmsw32ud.a C:\WxWidgetsSetup\lib\gcc_dll\libwxmsw32u.a
C:\u\CodeBlock_C++\EasyLoggingpp_ThreadNames\ThreadNames\easylogging++.cc: In member function 'el::Logger* el::base::RegisteredLoggers::get(const std::string&, bool)':

 


Regards JC.....

Online stahta01

  • Lives here!
  • ****
  • Posts: 7665
    • My Best Post
Re: g++.exe what -std=c++ <what version>
« Reply #1 on: April 22, 2024, 06:04:03 pm »
What ever is the default for the Compiler version installed!

Learn about the compiler you installed and the use a web search tool to find the default standard for C and C++.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1632
Re: g++.exe what -std=c++ <what version>
« Reply #2 on: April 22, 2024, 06:37:10 pm »
You can print the __cplusplus macro, see this link for more information.

Offline shouldersmulti

  • Single posting newcomer
  • *
  • Posts: 1
Re: g++.exe what -std=c++ <what version>
« Reply #3 on: July 22, 2024, 03:11:05 am »
You can print the __cplusplus macro, see this link for more information.
I followed and solved the problem. Thank you very much for the information.

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1632
Re: g++.exe what -std=c++ <what version>
« Reply #4 on: July 22, 2024, 10:00:38 am »
Future spam added to radar.

Offline Krice

  • Almost regular
  • **
  • Posts: 151
Re: g++.exe what -std=c++ <what version>
« Reply #5 on: August 28, 2024, 09:31:08 am »
If I do not specify in CB what to use, then how can I determine what has been used
(wrt C++ standard) ??

You do specify the C++ standard in project - build options (Have g++ follow the C++... options), it's the easiest way to know what C++ version is used.