codelite icon indicating copy to clipboard operation
codelite copied to clipboard

Unrecognized command line option '-std=c++20'

Open revans611 opened this issue 3 years ago • 6 comments

I have the same C++ Compiler Options for all projects in the workspace, but some work with c++20 and some don't. CodeLite IDE version 15.0.10, Windows 11, 64bit MinGW(C:\Program Files\mingw-w64\mingw64\bin)

"C:/Program Files/mingw-w64/mingw64/bin/mingw32-make.exe" -j8 SHELL=cmd.exe -e -f Makefile "----------Building project:[ Project2 - Debug ]----------" mingw32-make.exe[1]: Entering directory 'C:/Users/revan/OneDrive/Desktop/CPPProjects/Section4/Project2' g++.exe: error: unrecognized command line option '-std=c++20'; did you mean '-std=c++2a'? mingw32-make.exe[1]: *** [Project2.mk:99: Debug/main.cpp.o] Error 1 mingw32-make.exe: *** [Makefile:5: All] Error 2 mingw32-make.exe[1]: Leaving directory 'C:/Users/revan/OneDrive/Desktop/CPPProjects/Section4/Project2' === build completed successfully (0 errors, 0 warnings) ===

revans611 avatar Sep 06 '22 22:09 revans611

This is a compiler error, but what surprises me is that "some work with c++20 and some don't" are you using the same compiler for all the projects? is upgrading gcc an option, given the error means you're using gcc 9 or earlier

llogick avatar Sep 08 '22 07:09 llogick

I am using the same compiler for all the projects. If I switch to c++17 from c++20, they all work.

I am a noob at c++, and I am learning c++ and CodeLite via a tutorial on udemy.com. So I am new to some of the nomenclature and procedures involved in this type of compiling and linking.

I have tried to update to mingw-64 version 10, but the installer from SourceForge gives me an error stating that “file downloaded incorrectly.” According to the “Discussions” on the SourceForge page, this has been an ongoing issue for several years. Until I can get the upgrade resolved, I will not be able to determine if the g++ error is caused by the compiler or by the IDE.

revans611 avatar Sep 08 '22 16:09 revans611

Hmm, one could say that the IDE should consider the compiler and it's version to determine if a given option is valid for that particular compiler / compiler version, but in practice it's left to the developer ..

upgrading g++: Have you tried any of the other pre-built toolchains and packages? looking at that list I'd say viable candidates would be (ease of use > versatility) w64devkit Cygwin MSYS2 (what i use, but it is entirely CLI based)

llogick avatar Sep 08 '22 20:09 llogick

We build Codelite 16.5.0 itself : compiled with errors, wxWidgets-3.2.0


cmake 
        -G 'CodeLite - Unix Makefiles'          \
        -DCL_PREFIX=/usr/local                  \
        -DCMAKE_BUILD_TYPE=Release  \
        -DCOPY_WX_LIBS=1                      \
        -DENABLE_SFTP=0                         \
        -DCMAKE_CXX_STANDARD=20    
[ 23%] Building CXX object CodeLite/CMakeFiles/libcodelite.dir/clConsoleBase.cpp.o
make[2]: *** [CodeLite/CMakeFiles/libcodelite.dir/build.make:1341: CodeLite/CMakeFiles/libcodelite.dir/SocketAPI/clWebSocketClient.cpp.o] Error 1
make[2]: *** Waiting for tasks to be completed…
make[1]: *** [CMakeFiles/Makefile2:1123: CodeLite/CMakeFiles/libcodelite.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

cmake -B build/release                  \
      -G Ninja                          \
      -DCL_PREFIX=/usr/local            \
      -DCMAKE_BUILD_TYPE=Release        \
      -DCMAKE_INSTALL_PREFIX=/usr/local \
      -DENABLE_SFTP=0                   \
      -DCMAKE_CXX_STANDARD=20
[268/1910] Building CXX object CodeLit....dir/SocketAPI/clWebSocketClient.cpp.o
FAILED: CodeLite/CMakeFiles/libcodelite.dir/SocketAPI/clWebSocketClient.cpp.o
/usr/bin/c++ -DGTK_USE_NATIVEBOOK=1 -DINSTALL_DIR=\"/usr/local/share/codelite\" -DNDEBUG -DPLUGINS_DIR=\"/usr/local/lib/codelite\" -DUSE_SFTP=0 -DWXUSINGDLL -DWXUSINGDLL_WXSQLITE3 -DYY_NEVER_INTERACTIVE=1 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -Dlibcodelite_EXPORTS -DwxUSE_GUI=1 -I/usr/include/gtk-3.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 -I/media/u1/s1/0/codelite/sdk/wxsqlite3/include -I/media/u1/s1/0/codelite/sdk/codelite_indexer/network -I/media/u1/s1/0/codelite/sdk/websocketpp -I/media/u1/s1/0/codelite/sdk/asio-1.12.1 -I/media/u1/s1/0/codelite/CodeLite -I/media/u1/s1/0/codelite/PCH -I/media/u1/s1/0/codelite/Interfaces -isystem /usr/local/lib/wx/include/gtk3-unicode-3.2 -isystem /usr/local/include/wx-3.2 -Wno-deprecated-declarations -isystem /usr/include/harfbuzz -std=c++11 -g -O2 -ffile-prefix-map=/media/u1/s1/0/codelite=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -pthread -fPIC -fPIC   -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++20 -Winvalid-pch -include /media/u1/s1/0/codelite/build/release/CodeLite/CMakeFiles/libcodelite.dir/cmake_pch.hxx -MD -MT CodeLite/CMakeFiles/libcodelite.dir/SocketAPI/clWebSocketClient.cpp.o -MF CodeLite/CMakeFiles/libcodelite.dir/SocketAPI/clWebSocketClient.cpp.o.d -o CodeLite/CMakeFiles/libcodelite.dir/SocketAPI/clWebSocketClient.cpp.o -c /media/u1/s1/0/codelite/CodeLite/SocketAPI/clWebSocketClient.cpp
In file included from /media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/roles/client_endpoint.hpp:31,
                 from /media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/client.hpp:31,
                 from /media/u1/s1/0/codelite/CodeLite/SocketAPI/clWebSocketClient.cpp:15:
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/endpoint.hpp:112:5: error: template-id not allowed for destructor
  112 |     ~endpoint<connection,config>() {}
      |     ^
In file included from /media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/config/core_client.hpp:55,
                 from /media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/config/asio_no_tls_client.hpp:31,
                 from /media/u1/s1/0/codelite/CodeLite/SocketAPI/clWebSocketClient.cpp:16:
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:61:54: error: expected ‘)’ before ‘h’
   61 |     basic<concurrency,names>(channel_type_hint::value h =
      |                             ~                        ^~
      |                                                      )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:67:42: error: expected ‘)’ before ‘*’ token
   67 |     basic<concurrency,names>(std::ostream * out)
      |                             ~            ^~
      |                                          )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:72:35: error: expected ‘)’ before ‘c’
   72 |     basic<concurrency,names>(level c, channel_type_hint::value h =
      |                             ~     ^~
      |                                   )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:78:35: error: expected ‘)’ before ‘c’
   78 |     basic<concurrency,names>(level c, std::ostream * out)
      |                             ~     ^~
      |                                   )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:84:5: error: template-id not allowed for destructor
   84 |     ~basic<concurrency,names>() {}
      |     ^
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:87:54: error: expected ‘)’ before ‘const’
   87 |     basic<concurrency,names>(basic<concurrency,names> const & other)
      |                             ~                        ^~~~~~
      |                                                      )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:100:54: error: expected ‘)’ before ‘&&’ token
  100 |     basic<concurrency,names>(basic<concurrency,names> && other)
      |                             ~                        ^~~
      |                                                      )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/endpoint.hpp: In instantiation of ‘websocketpp::endpoint<connection, config>::endpoint(bool) [with connection = websocketpp::connection<websocketpp::config::asio_client>; config = websocketpp::config::asio_client]’:
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/roles/client_endpoint.hpp:72:44:   required from ‘websocketpp::client<config>::client() [with config = websocketpp::config::asio_client]’
/media/u1/s1/0/codelite/CodeLite/SocketAPI/clWebSocketClient.cpp:197:33:   required from here
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/endpoint.hpp:92:16: error: no matching function for call to ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>::basic(const websocketpp::log::level&, const websocketpp::log::channel_type_hint::value&)’
   92 |       : m_alog(new alog_type(config::alog_level, log::channel_type_hint::access))
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note: candidate: ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>::basic()’ (deleted)
   59 | class basic {
      |       ^~~~~
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note:   candidate expects 0 arguments, 2 provided
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note: candidate: ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>::basic(const websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>&)’ (deleted)
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note:   candidate expects 1 argument, 2 provided
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/endpoint.hpp:93:16: error: no matching function for call to ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>::basic(const websocketpp::log::level&, const websocketpp::log::channel_type_hint::value&)’
   93 |       , m_elog(new elog_type(config::elog_level, log::channel_type_hint::error))
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note: candidate: ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>::basic()’ (deleted)
   59 | class basic {
      |       ^~~~~
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note:   candidate expects 0 arguments, 2 provided
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note: candidate: ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>::basic(const websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>&)’ (deleted)
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note:   candidate expects 1 argument, 2 provided
[277/1910] Building CXX object CodeLit...elite.dir/clConsoleGnomeTerminal.cpp.o
ninja: build stopped: subcommand failed.
-e 
cmake -build after: 2022-09-24 18:39:49

[27/1634] Building CXX object CodeLite....dir/SocketAPI/clWebSocketClient.cpp.o
FAILED: CodeLite/CMakeFiles/libcodelite.dir/SocketAPI/clWebSocketClient.cpp.o 
/usr/bin/c++ -DGTK_USE_NATIVEBOOK=1 -DINSTALL_DIR=\"/usr/local/share/codelite\" -DNDEBUG -DPLUGINS_DIR=\"/usr/local/lib/codelite\" -DUSE_SFTP=0 -DWXUSINGDLL -DWXUSINGDLL_WXSQLITE3 -DYY_NEVER_INTERACTIVE=1 -D_FILE_OFFSET_BITS=64 -D__WXGTK__ -Dlibcodelite_EXPORTS -DwxUSE_GUI=1 -I/usr/include/gtk-3.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 -I/media/u1/s1/0/codelite/sdk/wxsqlite3/include -I/media/u1/s1/0/codelite/sdk/codelite_indexer/network -I/media/u1/s1/0/codelite/sdk/websocketpp -I/media/u1/s1/0/codelite/sdk/asio-1.12.1 -I/media/u1/s1/0/codelite/CodeLite -I/media/u1/s1/0/codelite/PCH -I/media/u1/s1/0/codelite/Interfaces -isystem /usr/local/lib/wx/include/gtk3-unicode-3.2 -isystem /usr/local/include/wx-3.2 -Wno-deprecated-declarations -isystem /usr/include/harfbuzz -std=c++11 -g -O2 -ffile-prefix-map=/media/u1/s1/0/codelite=. -fstack-protector-strong -Wformat -Werror=format-security -O2 -pthread -fPIC -fPIC   -Wdate-time -D_FORTIFY_SOURCE=2 -std=gnu++20 -Winvalid-pch -include /media/u1/s1/0/codelite/build/release/CodeLite/CMakeFiles/libcodelite.dir/cmake_pch.hxx -MD -MT CodeLite/CMakeFiles/libcodelite.dir/SocketAPI/clWebSocketClient.cpp.o -MF CodeLite/CMakeFiles/libcodelite.dir/SocketAPI/clWebSocketClient.cpp.o.d -o CodeLite/CMakeFiles/libcodelite.dir/SocketAPI/clWebSocketClient.cpp.o -c /media/u1/s1/0/codelite/CodeLite/SocketAPI/clWebSocketClient.cpp
In file included from /media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/roles/client_endpoint.hpp:31,
                 from /media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/client.hpp:31,
                 from /media/u1/s1/0/codelite/CodeLite/SocketAPI/clWebSocketClient.cpp:15:
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/endpoint.hpp:112:5: error: template-id not allowed for destructor
  112 |     ~endpoint<connection,config>() {}
      |     ^
In file included from /media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/config/core_client.hpp:55,
                 from /media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/config/asio_no_tls_client.hpp:31,
                 from /media/u1/s1/0/codelite/CodeLite/SocketAPI/clWebSocketClient.cpp:16:
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:61:54: error: expected ‘)’ before ‘h’
   61 |     basic<concurrency,names>(channel_type_hint::value h =
      |                             ~                        ^~
      |                                                      )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:67:42: error: expected ‘)’ before ‘*’ token
   67 |     basic<concurrency,names>(std::ostream * out)
      |                             ~            ^~
      |                                          )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:72:35: error: expected ‘)’ before ‘c’
   72 |     basic<concurrency,names>(level c, channel_type_hint::value h =
      |                             ~     ^~
      |                                   )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:78:35: error: expected ‘)’ before ‘c’
   78 |     basic<concurrency,names>(level c, std::ostream * out)
      |                             ~     ^~
      |                                   )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:84:5: error: template-id not allowed for destructor
   84 |     ~basic<concurrency,names>() {}
      |     ^
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:87:54: error: expected ‘)’ before ‘const’
   87 |     basic<concurrency,names>(basic<concurrency,names> const & other)
      |                             ~                        ^~~~~~
      |                                                      )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:100:54: error: expected ‘)’ before ‘&&’ token
  100 |     basic<concurrency,names>(basic<concurrency,names> && other)
      |                             ~                        ^~~
      |                                                      )
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/endpoint.hpp: In instantiation of ‘websocketpp::endpoint<connection, config>::endpoint(bool) [with connection = websocketpp::connection<websocketpp::config::asio_client>; config = websocketpp::config::asio_client]’:
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/roles/client_endpoint.hpp:72:44:   required from ‘websocketpp::client<config>::client() [with config = websocketpp::config::asio_client]’
/media/u1/s1/0/codelite/CodeLite/SocketAPI/clWebSocketClient.cpp:197:33:   required from here
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/endpoint.hpp:92:16: error: no matching function for call to ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>::basic(const websocketpp::log::level&, const websocketpp::log::channel_type_hint::value&)’
   92 |       : m_alog(new alog_type(config::alog_level, log::channel_type_hint::access))
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note: candidate: ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>::basic()’ (deleted)
   59 | class basic {
      |       ^~~~~
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note:   candidate expects 0 arguments, 2 provided
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note: candidate: ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>::basic(const websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::alevel>&)’ (deleted)
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note:   candidate expects 1 argument, 2 provided
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/endpoint.hpp:93:16: error: no matching function for call to ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>::basic(const websocketpp::log::level&, const websocketpp::log::channel_type_hint::value&)’
   93 |       , m_elog(new elog_type(config::elog_level, log::channel_type_hint::error))
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note: candidate: ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>::basic()’ (deleted)
   59 | class basic {
      |       ^~~~~
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note:   candidate expects 0 arguments, 2 provided
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note: candidate: ‘websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>::basic(const websocketpp::log::basic<websocketpp::concurrency::basic, websocketpp::log::elevel>&)’ (deleted)
/media/u1/s1/0/codelite/sdk/websocketpp/websocketpp/logger/basic.hpp:59:7: note:   candidate expects 1 argument, 2 provided
[36/1634] Building CXX object CodeLite...libcodelite.dir/cl_command_event.cpp.o
ninja: build stopped: subcommand failed.

domr2695 avatar Sep 24 '22 15:09 domr2695

thanks for reporting this. the entire websocket code will be removed from CodeLite as we moved to DAP as our main debugger platform and all custom debuggers are going away

eranif avatar Oct 22 '22 19:10 eranif

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs (within 5 days). Thank you for your contributions.

stale[bot] avatar Jun 18 '23 16:06 stale[bot]