||error: unrecognized command line option '-std=gnu++20'; did you mean '-std=gnu++2a'?| error in Codeblocks 20.03 for windows - codeblocks

After installing codeblocks c files running but c++ files not running and showing this:
error: unrecognized command line option '-std=gnu++20'; did you mean '-std=gnu++2a'?

It's a compiler error. Click on Compiler settings and under Compiler Flags make sure that General has nothing selected.

Under Settings->Compiler select "Other Compiler Option" tab and change "-std=gnu++20" to -"std=gnu++2a".
That solves the problem.

Related

Building OBS Studio Music Edition on windows CMake 'Configure' error

I'm having a problem building obs music edition on windows, running "Configure" on cmake-gui.
I got this error
CMake Warning (dev) at plugins/win-asio/CMakeLists.txt:38 (target_link_libraries):
Link library type specifier "optimized" is followed by specifier "debug"
instead of a library name. The first specifier will be ignored.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error at plugins/win-asio/CMakeLists.txt:38 (target_link_libraries):
The "debug" argument must be followed by a library.
Configuring incomplete, errors occurred!
I attach an image with my current config:
Anyone has any idea what might be?
Thanks in advance

MinGW gcc isn't able to compile a simple test program(same with cygwin) in CLion

I've just installed CLion and i needed compiler. I installed Cygwin.
But there was an error:
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
CMake Error: Error executing cmake::LoadCache(). Aborting.
Error code: 1
So, CMake was "bundled" and i tried to install it from site. But there was the next error:
Selected CMake might be incompatible with the Cygwin environment.
In order to run on Cygwin, CMake needs to be specially compiled.
Please select either CMake bundled with CLion or CMake from the Cygwin installation.
CMake Error: The source directory "/cygdrive/c/Users/Пользователь/AppData/Local/Temp/cmake_check_environment" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Error code: 1
Then i've tried to install MinGW - this time it was the following problem:
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: D:/MinGW/mingw64/bin/gcc.exe
-- Check for working C compiler: D:/MinGW/mingw64/bin/gcc.exe -- broken
CMake Error at D:/CLion 182.2574.4/bin/cmake/share/cmake-3.11/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"D:/MinGW/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Пользователь/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp
Run Build Command:"D:/MinGW/mingw64/bin/mingw32-make.exe" "cmTC_a4ce5/fast"
D:/MinGW/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_a4ce5.dir\build.make CMakeFiles/cmTC_a4ce5.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/╧юы№чютрЄхы№/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a4ce5.dir/testCCompiler.c.obj
D:\MinGW\mingw64\bin\gcc.exe -o CMakeFiles\cmTC_a4ce5.dir\testCCompiler.c.obj -c C:\Users\╨Я╨╛╨╗╤М╨╖╨╛╨▓╨░╤В╨╡╨╗╤М\AppData\Local\Temp\cmake_check_environment\_build\CMakeFiles\CMakeTmp\testCCompiler.c
gcc.exe: error: C:\Users\╨Я╨╛╨╗╤М╨╖╨╛╨▓╨░╤В╨╡╨╗╤М\AppData\Local\Temp\cmake_check_environment\_build\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
mingw32-make.exe[1]: *** [CMakeFiles\cmTC_a4ce5.dir\build.make:65: CMakeFiles/cmTC_a4ce5.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Users/╧юы№чютрЄхы№/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp'
mingw32-make.exe: *** [Makefile:125: cmTC_a4ce5/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Пользователь/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Пользователь/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeError.log".
Error code: 1
In both cases it's problems with paths, i think. I tried to give root to CLion, gcc, etc. - nothing.
I've tried to find logs or just way to this path - but all was worthless - path doesn't exist.I just can't find out, why that's happening.
Help me, please
Looks like there is a problem with encodings somewhere between windows/cygwin/clion/cmake (I assume you user name is non-ascii).
As a quick workaround try:
installing CLion in the location without non-latin symbols
changing CLion's system and config folders to the location without non-latin symbols. instructions
And to troubleshoot the problem, could you please check if the cygwin's console shows the user home path correctly? (e.g. use ls /cygdrive/c/Users/, then cd to the user home path).
If Cygwin can correctly work with the user home, could you please file a bug report and attach CLion's log files? (Help | Show Log in Explorer)

Configuring wxWidgets for OS X 10.10

I am trying to build a program that relies on wxWidgets to run properly. I have the latest version of Xcode installed. I have tried building wxWidgets (both wxWidgets-3.0.2 and wxWidgets-2.9.4, the version originally used by the main program). However, in both cases, running the makefile for the main program gives the following error:
make: /Users/path to wxWidgets/wxWidgets-2.9.4/build-cocoa-release/utils/wxrc/wxrc: No such file or directory
As I understand it, I need to build wxrc to get my main program to build properly (I have tried this, but apparently some header files are missing). Is there any way to configure wxWidgets before this step that will automatically build wxrc as well? Or is that something I need to build separately? If it is separate, how would that be done?
I've pasted the code I originally used to configure wxWidgets below, with line breaks to make it easier to read:
../configure --with-osx_cocoa --with-macosx-version-min=10.7
--with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk
--prefix="$(pwd)" --with-opengl CC=clang CXX=clang++ CXXFLAGS="-stdlib=libc++ -std=c++11"
OBJCXXFLAGS="-stdlib=libc++ -std=c++11" LDFLAGS=-stdlib=libc++
There is one error while building wxWidgets:
../src/osx/cocoa/utils.mm:250:28: error: cannot initialize a parameter of type 'id' with an lvalue of type
'wxNSAppController *'
[NSApp setDelegate:appcontroller];
When I go into the samples directory and enter "make", I get: ld: library not found for -lwx_osx_cocoau_xrc-2.9 clang: error: linker command failed with exit code 1 (use -v to see invocation) When entering "make" in demos, I get: ld: library not found for -lwx_osx_cocoau_core-2.9 clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I missed any steps I should have taken before these (something with Xcode maybe?) please let me know. Thank you very much in advance.
Similar question. I have sugested a workaround proposed on a forum as follows: you can use --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/".

D Windows programming linker error

While trying to compile this program with an up-to-date compiler: https://github.com/AndrejMitrovic/DWinProgramming/blob/master/Samples/Chap03/HelloWin/HelloWin.d
I get this linker error: Error 42: Symbol Undefined _D5win327winuser13CreateWindowWFPxuPxukiiiiPvPvPvPvZPv
That's a mangled name, so the problem isn't the Windows libraries themselves... my guess is the dmd_win32.lib file from here https://github.com/AndrejMitrovic/DWinProgramming is needed too.
Try downloading that and adding it to your compile command line. dmd Hellowin.d dmd_win32.lib

Disable warnings in llvm-gcc

I'm trying to build an open source project with llvm-gcc 4.2 with -emit-llvm flag.
However I get many errors due to warning flags.
Example of these errors:
cc1: error: unrecognized command line option "-Warray-bounds"
cc1: error: unrecognized command line option "-Wjump-misses-init"
cc1: error: unrecognized command line option "-Wvla"
cc1: error: unrecognized command line option "-Wignored-qualifiers"
cc1: error: unrecognized command line option "-Wlogical-op"
cc1: error: unrecognized command line option "-fexcess-precision=fast"
In clang I would use -Wno-error to ignore them, but that doesn't seem to work with llvm-gcc.
Manually removing the flags does not seem reasonable considering that there are 144 Makefiles.
How would I approach this problem?
I was trying hard to search for recent information on llvm-gcc and failed. I concluded that it's a dead project that was part of former LLVM releases but is no longer actively developed. Therefore it doesn't support the same set of warnings as current GCC versions and you cannot expect it to work with the same command line.
The errors you're getting tell you which CLI options are not supported and you have no choice than to remove them or stop using llvm-gcc and switch to something more modern. According to the LLVM website, the project you're looking for is called dragonegg.
http://dragonegg.llvm.org/

Resources