Author Topic: CB 25.02 included binaries do not support mingw clangd  (Read 3160 times)

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2873
CB 25.02 included binaries do not support mingw clangd
« on: May 02, 2025, 08:06:24 pm »
The 25.03 MinGW binaries cannot be used as the clangd.exe target for Clangd_client plugin.

The WinLib MinGW clang resouces (lib/clang/19) are for use of the clang compiler only and not for projects buit with mingw (g++).

That's why msys2 separates mingw64 and clang64 into separate folders, so that each can have it's own bin and lib resources.

With the current WinLib distribution binaries, our clangd_client should not be specified to use the MinGW directory distributed with 25.03. It will cause all sort of spurious errors.
« Last Edit: May 02, 2025, 08:11:13 pm by Pecan »

Offline gd_on

  • Lives here!
  • ****
  • Posts: 824
Re: CB 25.02 included binaries do not support mingw clangd
« Reply #1 on: May 03, 2025, 05:36:31 pm »
What about the msys2 package : mingw-w64-x86_64-clang-tools-extra in which clangd is included inside msys64\mingw64\bin folder ? For me, msys64\clang64 contains only empty folders.
I don't see many problems with this package (but I can have missed them). Could you tell us more precisely some of those "spurious errors".
« Last Edit: May 03, 2025, 06:19:35 pm by gd_on »
Windows 11 64 bits (24H2), svn C::B (last version or almost!), wxWidgets 3.2.8 (tests with 3.3), Msys2 Compilers 15.1.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2873
Re: CB 25.02 included binaries do not support mingw clangd
« Reply #2 on: May 03, 2025, 09:18:35 pm »
What about the msys2 package : mingw-w64-x86_64-clang-tools-extra in which clangd is included inside msys64\mingw64\bin folder ? For me, msys64\clang64 contains only empty folders.
I don't see many problems with this package (but I can have missed them). Could you tell us more precisely some of those "spurious errors".

Firstly, msys2 packages do not have the problem. Only the WinLibs binaries installed with CB 25.03 have the problem.

That clang64 is empty is perfectly ok.

But mingw64\bin should contain clangd.exe, which is the correct executable to set for clangd_client.

Using the msys mingw64 packages are exactly what you want to do.

Here are some of the spurious errors when using the MinGW folder distributed with CB 25.03.

The following errors are caused by using the wrong resource lib
for mingw clangd.exe. Clangd is issueing all these errors because it's ignoring anonymouse namespace.
Some of the errors make absolutely no sense at all.

The error: "remark:'_sleep' is deprecated|" makes no sense at all for a statement like:
"    int pos = clangPath.find(fileSep+"lib"+fileSep);
"

Code
LSP diagnostics: ClangLocator.cpp|:|----Time: 12:02:21.037---- (20 diagnostics)|
ClangLocator.cpp|65|error:Use of undeclared identifier 'fileSepChar'|
ClangLocator.cpp|84|error:Use of undeclared identifier 'fileSep'|
ClangLocator.cpp|84|error:Use of undeclared identifier 'clangdexe'; did you mean 'clangdDir'? (fix available) change 'clangdexe' to 'clangdDir'|
ClangLocator.cpp|107|error:Use of undeclared identifier 'fileSep'|
ClangLocator.cpp|149|error:Use of undeclared identifier 'fileSep'|
ClangLocator.cpp|149|error:Use of undeclared identifier 'fileSep'|
ClangLocator.cpp|174|error:Use of undeclared identifier 'fileSep'|
ClangLocator.cpp|174|error:Use of undeclared identifier 'fileSep'|
ClangLocator.cpp|174|remark:'_sleep' is deprecated|
ClangLocator.cpp|186|error:Use of undeclared identifier 'fileSep'|
ClangLocator.cpp|313|error:Use of undeclared identifier 'clangdexe'|
ClangLocator.cpp|317|error:Use of undeclared identifier 'fileSep'|
ClangLocator.cpp|351|error:Use of undeclared identifier 'fileSep'|
ClangLocator.cpp|381|error:Use of undeclared identifier 'fileSep'|
ClangLocator.cpp|396|error:Use of undeclared identifier 'fileSep'|
ClangLocator.cpp|413|error:Use of undeclared identifier 'clangdexe'|
ClangLocator.cpp|456|error:Use of undeclared identifier 'LLVM_Dirmaybe'|
ClangLocator.cpp|599|error:Use of undeclared identifier 'wxFound'; did you mean 'wxRound'? (fix available) change 'wxFound' to 'wxRound'|
ClangLocator.cpp|599|remark:'wxRound<int>' is deprecated: rounding an integer is useless|
ClangLocator.cpp|5|warning:Included header cstdint is not used directly (fix available) remove #include directive|
LSP diagnostics: ccoptionsdlg.cpp|:|----Time: 12:02:24.299---- (4 diagnostics)|
codecompletion\ccoptionsdlg.cpp|575|error:Use of undeclared identifier 'clangdexe'|
codecompletion\ccoptionsdlg.cpp|582|error:Use of undeclared identifier 'LLVM_Dirmaybe'|
codecompletion\ccoptionsdlg.cpp|582|error:Use of undeclared identifier 'clangdexe'|
codecompletion\ccoptionsdlg.cpp|636|error:Use of undeclared identifier 'clangdexe'|
LSP diagnostics: client.cpp|:|----Time: 12:02:25.385---- (22 diagnostics)|
LSPclient\client.cpp|398|error:Use of undeclared identifier 'clangdexe'|
LSPclient\client.cpp|434|error:Use of undeclared identifier 'fileSep'|
LSPclient\client.cpp|434|error:Use of undeclared identifier 'fileSep'|
LSPclient\client.cpp|434|remark:'_sleep' is deprecated|
LSPclient\client.cpp|438|error:Use of undeclared identifier 'fileSep'|
LSPclient\client.cpp|438|error:Use of undeclared identifier 'clangdexe'|
LSPclient\client.cpp|438|remark:'_sleep' is deprecated|
LSPclient\client.cpp|560|error:Use of undeclared identifier 'GetstdUTF8Str'; did you mean 'GetwxUTF8Str'? (fix available) change 'GetstdUTF8Str' to 'GetwxUTF8Str'|
LSPclient\client.cpp|560|error:No viable conversion from 'const wxString' to 'std::string' (aka 'basic_string<char>')|
LSPclient\client.cpp|560|error:Use of undeclared identifier 'GetstdUTF8Str'; did you mean 'GetwxUTF8Str'? (fix available) change 'GetstdUTF8Str' to 'GetwxUTF8Str'|
LSPclient\client.cpp|560|error:No viable conversion from 'const wxString' to 'std::string' (aka 'basic_string<char>')|
LSPclient\client.cpp|741|error:Use of undeclared identifier 'fileSep'|
LSPclient\client.cpp|742|error:Use of undeclared identifier 'fileSep'|
LSPclient\client.cpp|743|error:Use of undeclared identifier 'fileSep'|
LSPclient\client.cpp|744|error:Use of undeclared identifier 'fileSep'|
LSPclient\client.cpp|797|error:Use of undeclared identifier 'StdString_EndsWith'|
LSPclient\client.cpp|817|error:Use of undeclared identifier 'StdString_Contains'|
LSPclient\client.cpp|818|error:Use of undeclared identifier 'StdString_Contains'|
LSPclient\client.cpp|822|error:Use of undeclared identifier 'stdFound'|
LSPclient\client.cpp|1074|error:Use of undeclared identifier 'stdFound'|
LSPclient\client.cpp|1128|error:Use of undeclared identifier 'StdString_Format'|
LSPclient\client.cpp|1|error:Too many errors emitted, stopping now|
LSP diagnostics: codecompletion.cpp|:|----Time: 12:02:26.280---- (25 diagnostics)|
codecompletion\codecompletion.cpp|488|error:Use of undeclared identifier 'ns_DefaultCompilerMasterPath'|
codecompletion\codecompletion.cpp|489|error:Use of undeclared identifier 'ns_DefaultCompilerMasterPath'|
codecompletion\codecompletion.cpp|612|error:Use of undeclared identifier 'ns_DefaultCompilerMasterPath'|
codecompletion\codecompletion.cpp|613|error:Use of undeclared identifier 'ns_DefaultCompilerMasterPath'|
codecompletion\codecompletion.cpp|1031|error:Use of undeclared identifier 'wxFound'; did you mean 'wxRound'? (fix available) change 'wxFound' to 'wxRound'|
codecompletion\codecompletion.cpp|1031|remark:'wxRound<int>' is deprecated: rounding an integer is useless|
codecompletion\codecompletion.cpp|1052|error:Use of undeclared identifier 'wxFound'; did you mean 'wxRound'? (fix available) change 'wxFound' to 'wxRound'|
codecompletion\codecompletion.cpp|1052|remark:'wxRound<int>' is deprecated: rounding an integer is useless|
codecompletion\codecompletion.cpp|1055|error:Use of undeclared identifier 'wxFound'; did you mean 'wxRound'? (fix available) change 'wxFound' to 'wxRound'|
codecompletion\codecompletion.cpp|1055|remark:'wxRound<int>' is deprecated: rounding an integer is useless|
codecompletion\codecompletion.cpp|1063|error:Use of undeclared identifier 'wxFound'; did you mean 'wxRound'? (fix available) change 'wxFound' to 'wxRound'|
codecompletion\codecompletion.cpp|1063|remark:'wxRound<int>' is deprecated: rounding an integer is useless|
codecompletion\codecompletion.cpp|1187|error:Use of undeclared identifier 'ns_DefaultCompilerMasterPath'|
codecompletion\codecompletion.cpp|3078|error:Use of undeclared identifier 'clangdexe'|
codecompletion\codecompletion.cpp|3093|error:Use of undeclared identifier 'clangdexe'|
codecompletion\codecompletion.cpp|3438|error:Use of undeclared identifier 'STXstring'; did you mean 'String'? (fix available) change 'STXstring' to 'String'|
codecompletion\codecompletion.cpp|3446|error:Use of undeclared identifier 'STXstring'; did you mean 'String'? (fix available) change 'STXstring' to 'String'|
codecompletion\codecompletion.cpp|3448|error:Use of undeclared identifier 'STX'|
codecompletion\codecompletion.cpp|3449|error:Use of undeclared identifier 'STXstring'|
codecompletion\codecompletion.cpp|3450|error:Use of undeclared identifier 'STX'|
codecompletion\codecompletion.cpp|3453|error:Use of undeclared identifier 'STXstring'; did you mean 'String'? (fix available) change 'STXstring' to 'String'|
codecompletion\codecompletion.cpp|3521|error:Use of undeclared identifier 'STX'|
codecompletion\codecompletion.cpp|3524|error:Use of undeclared identifier 'STX'|
codecompletion\codecompletion.cpp|1|error:Too many errors emitted, stopping now|
codecompletion\codecompletion.cpp|14|warning:Included header iterator is not used directly (fix available) remove #include directive|


« Last Edit: May 03, 2025, 09:21:50 pm by Pecan »

Offline Wkerry

  • Multiple posting newcomer
  • *
  • Posts: 100
Re: CB 25.02 included binaries do not support mingw clangd
« Reply #3 on: May 04, 2025, 01:26:41 am »
When using mingw64\bin if you get errors with cc1plus.exe on C:B startup then check if the "GNU GCC Compiler" installation directory is C:\msys64\mingw32 and if it is then change it to C:\msys64\mingw64 and the error goes away.