Recent Posts

Pages: 1 2 3 4 [5] 6 7 8 9 10
41
Plugins development / Re: Code completion using LSP and clangd
« Last post by garwin on March 13, 2024, 09:21:41 pm »
@Pecan

From the project cbp file or choosing a project from recent projects on the main codeblocks window.

It seems to me that clangd needs GCC standard library headers but cannot find them. But I have no idea how to tell Clangd where to find them, especially as they are in a lot of folders in MinGW.
I have tried to add to most of these directories in compiler search directories but it does not help.
42
Plugins development / Re: Code completion using LSP and clangd
« Last post by Pecan on March 13, 2024, 09:04:51 pm »
@ garwin
Are you opening the example program file from a <projectName>.cbp file or as a single c++ file?
43
Plugins development / Re: Code completion using LSP and clangd
« Last post by garwin on March 13, 2024, 08:42:27 pm »
@ garwin

It looks like the problem is that neither Compiler nor Clangd_client can find the fully installed compiler.

How and where did you actually install (not copied) the mingw compiler?

How and where did you install (not copied) clangd?

Codeblocks find installed compiler as it compiles code without any problem.

MinGW 13.1
This version - https://github.com/brechtsanders/winlibs_mingw/releases/download/13.1.0-16.0.5-11.0.0-msvcrt-r5/winlibs-x86_64-posix-seh-gcc-13.1.0-mingw-w64msvcrt-11.0.0-r5.7z
copied to:
Codeblocks\MinGW 13.1

Compiler setup


Debugger setup


And it compiles correctly code from previous post.
Code
Output file is bin\Debug\TEST_CLANGD.exe with size 70.53 KB
Process terminated with status 0 (0 minute(s), 1 second(s))
0 error(s), 0 warning(s) (0 minute(s), 1 second(s))

Clangd
clangd.exe
msvcp140.dll
vcruntime140.dll
vceruntime140_1.dll

copied to:
Codeblocks\Clangd
which is setup in the plugin.



note: I have even tried to unzip whole LLMV-17.0.6.-win64.exe and set path to this clangd
44
Plugins development / Re: Code completion using LSP and clangd
« Last post by Pecan on March 13, 2024, 08:19:40 pm »
@ garwin

It looks like the problem is that neither Compiler nor Clangd_client can find the fully installed compiler.

How and where did you actually install (not copied) the mingw compiler?

How and where did you install (not copied) clangd?
45
Plugins development / Re: Code completion using LSP and clangd
« Last post by garwin on March 13, 2024, 07:58:09 pm »
@Pecan
Thank you for helping, I am just hobbiest, so these toolchains and all the settings are difficult to me, but I like simplicity and your plugin would really help compared to code completion plugin which sometimes works, sometimes does not, especially for member functions.

I have just finished an additional try and was able to make Clangd plugin work but with an obscure way and not fully. See below. So now I need:
- to make plugin Clangd working with standard library (point 1 below)
- to find why I need really obscure way to run that plugin (point 2 below)

1. Actual status - The plugin is working but anything from std namespace does not
It seems, that that Clangd is unable to locate library headers. I have added to the compiler search directory:
... Codeblocks\MinGW 13.1\include
... Codeblocks\MinGW 13.1\include\c++
... Codeblocks\MinGW 13.1\include\c++\13.1.0
... Codeblocks\MinGW 13.1\lib\gcc\x86_64-w64-mingw32\13.1.0\include
... Codeblocks\MinGW 13.1\lib\gcc\x86_64-w64-mingw32\13.1.0
... Codeblocks\MinGW 13.1\lib\gcc\x86_64-w64-mingw32

It did not help.

This is from LSP message:
Code
LSP diagnostics: main.cpp|:|----Time: 19:49:39.185---- (4 diagnostics)|
C:\Users\tnadrchal\Documents\_Ostatni\C++\TESTS\_WORKING\TEST_CLANGD\TEST_CLANGD\main.cpp|1|error:In included file: 'bits/c++config.h' file not found|
C:\Users\tnadrchal\Documents\_Ostatni\C++\TESTS\_WORKING\TEST_CLANGD\TEST_CLANGD\main.cpp|5|error:No member named 'cout' in namespace 'std'|
C:\Users\tnadrchal\Documents\_Ostatni\C++\TESTS\_WORKING\TEST_CLANGD\TEST_CLANGD\main.cpp|5|error:No member named 'endl' in namespace 'std'|
C:\Users\tnadrchal\Documents\_Ostatni\C++\TESTS\_WORKING\TEST_CLANGD\TEST_CLANGD\main.cpp|1|warning:Included header iostream is not used directly (fix available) remove #include directive|


This is basic testing code.
Code
#include <iostream>

int main()
{
    std::cout << "Test" << std::endl;
    return 0;
}

Code
Loaded config file 'C:\Users\tnadrchal\AppData\Roaming\CodeBlocks\default.conf' (personality: 'default')
Scanning for lexers in C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\share\codeblocks/lexers/...
Found 62 lexers
Loading lexer_A68k
Loading lexer_ada
Loading lexer_angelscript
Loading lexer_autotools
Loading lexer_bash
Loading lexer_batch
Loading lexer_bibtex
Loading lexer_caml
Loading lexer_cg
Loading lexer_cmake
Loading lexer_coffee
Loading lexer_cpp
Loading lexer_css
Loading lexer_cu
Loading lexer_d
Loading lexer_diff
Loading lexer_f77
Loading lexer_fortran
Loading lexer_glsl
Loading lexer_gm
Loading lexer_haskell
Loading lexer_hitasm
Loading lexer_html
Loading lexer_ihex
Loading lexer_inno
Loading lexer_java
Loading lexer_javascript
Loading lexer_latex
Loading lexer_lisp
Loading lexer_lua
Loading lexer_make
Loading lexer_markdown
Loading lexer_masm
Loading lexer_matlab
Loading lexer_nim
Loading lexer_nsis
Loading lexer_objc
Loading lexer_OgreCompositor
Loading lexer_OgreMaterial
Loading lexer_pascal
Loading lexer_perl
Loading lexer_plain
Loading lexer_po
Loading lexer_postscript
Loading lexer_powershell
Loading lexer_prg
Loading lexer_properties
Loading lexer_proto
Loading lexer_python
Loading lexer_rc
Loading lexer_registry
Loading lexer_ruby
Loading lexer_smalltalk
Loading lexer_sql
Loading lexer_squirrel
Loading lexer_srec
Loading lexer_tehex
Loading lexer_vbscript
Loading lexer_verilog
Loading lexer_vhdl
Loading lexer_xml
Loading lexer_yaml
Configured 0 tools
Scanning for plugins in C:\Users\tnadrchal\AppData\Roaming\CodeBlocks\share\codeblocks\plugins
Loaded 0 plugins
Scanning for plugins in C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\share\codeblocks\plugins
Tools Plus Plugin: Registering shell type Piped Process Control
Loaded 65 plugins
Loading:
Abbreviations
AStylePlugin
Autosave
AutoVersioning
BrowseTracker
BYOGames
CB_Koders
Cccc
clangd_client
ClassWizard
CodeSnippets
CodeStat
Compiler
copystrings
CppCheck
Cscope
Debugger
FilesExtensionHandler
DevPakUpdater
DoxyBlocks
cbDragScroll
EditorConfig
EditorTweaks
EnvVars
Exporter
FileManager
FortranProject
Scanning for lexers in C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\share\codeblocks/lexers/...
Found 62 lexers
Loading lexer_A68k
Loading lexer_ada
Loading lexer_angelscript
Loading lexer_autotools
Loading lexer_bash
Loading lexer_batch
Loading lexer_bibtex
Loading lexer_caml
Loading lexer_cg
Loading lexer_cmake
Loading lexer_coffee
Loading lexer_cpp
Loading lexer_css
Loading lexer_cu
Loading lexer_d
Loading lexer_diff
Loading lexer_f77
Loading lexer_fortran
Loading lexer_glsl
Loading lexer_gm
Loading lexer_haskell
Loading lexer_hitasm
Loading lexer_html
Loading lexer_ihex
Loading lexer_inno
Loading lexer_java
Loading lexer_javascript
Loading lexer_latex
Loading lexer_lisp
Loading lexer_lua
Loading lexer_make
Loading lexer_markdown
Loading lexer_masm
Loading lexer_matlab
Loading lexer_nim
Loading lexer_nsis
Loading lexer_objc
Loading lexer_OgreCompositor
Loading lexer_OgreMaterial
Loading lexer_pascal
Loading lexer_perl
Loading lexer_plain
Loading lexer_po
Loading lexer_postscript
Loading lexer_powershell
Loading lexer_prg
Loading lexer_properties
Loading lexer_proto
Loading lexer_python
Loading lexer_rc
Loading lexer_registry
Loading lexer_ruby
Loading lexer_smalltalk
Loading lexer_sql
Loading lexer_squirrel
Loading lexer_srec
Loading lexer_tehex
Loading lexer_vbscript
Loading lexer_verilog
Loading lexer_vhdl
Loading lexer_xml
Loading lexer_yaml
HeaderFixup
Header Guard
HelpPlugin
Help plugin ini file: C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\share\codeblocks\docs\index.ini
HexEditor
IncrementalSearch
cbKeyBinder
lib_finder
LogHacker
ModPoller
MouseSap
NassiShneidermanPlugin
OccurrencesHighlighting
OpenFilesList
Profiler
ProjectOptionsManipulator
ProjectsImporter
RegExTestbed
ReopenEditor
rndgen
ScriptedWizard
SmartIndentCpp
SmartIndentFortran
SmartIndentHDL
SmartIndentLua
SmartIndentPascal
SmartIndentPython
SmartIndentXML
SpellChecker
SymTab
ThreadSearch
tidycmt
ToDoList
ToolsPlus
wxSmith
wxSmithMime
wxSmithAui
wxSmithContribItems
WindowsXPLookNFeel
Initial scaling factor is 1.000 (actual: 1.000)
Running startup script
Script plugin registered: Find Broken Files plugin
Script/function 'edit_startup_script.script' registered under menu '&Settings/-Edit startup script'
ClangdClient: allocating ProxyProject (phase 1).
Opening C:\Users\tnadrchal\AppData\Roaming\CodeBlocks/CC_ProxyProject.cbp
Done.
ClangdClient: loading ProxyProject (phase 2.
Opening C:\Users\tnadrchal\AppData\Roaming\CodeBlocks/CC_ProxyProject.cbp
Done.
Parsing 0 files took 0 ms
SpellChecker: Thesaurus files 'C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\share\codeblocks\SpellChecker\th_en_US.idx' not found!


2. How I did it.
I have not installed MinGW, I have just copy whole MinGW folder under Codeblocks and setup compiler after first opening correctly as it works.
Under Compiler setttings->Selected Compiler I always make copy of default (not setup) GNU GCC Compiler. In this case GNU GCC Compiler 13.1 and setup it correctly and make it default. Run easy code and check that it works.
But if I do that Clangd plugin is always automatically disabled on opening or inactive after enabling it. When I tried to setup original default GNU GCC Compiler in same way, it works and I get to point 1 describe above. This is really strange.

I have included config file in zip, I do not want to spam this forum as it is quite a number of rows.




46
Plugins development / Re: Code completion using LSP and clangd
« Last post by Pecan on March 13, 2024, 07:15:12 pm »
@garwin

Please provide the following information so that I can setup my environment the same as yours and try to detect the error.

Within code tags (the # icon above the reply box) provide the appdata\roaming\codeblocks\ "personality" causing the problem. In the example below the "personality" is "default" at the bottom right of the codeblocks window (yours may be different). It will reside at \users\<your pc users name>\appdata\roaming\codeblocks\<personality name>.conf .

Also provide the codeblocks log (within code tags). The title of the tab is "Code::Blocks". It may look empty, but just use the mouse wheel up or down to see the data.
Right click on the tab title and select copy to clipboard.
Then paste it between code tags so we can analyze it.

Tell me exactly how to start codeblocks.exe the same way you do to cause the error.
47
General (but related to Code::Blocks) / Re: CB C++ Issue with GNU C++ 17 (ISO)
« Last post by Grit Clef on March 13, 2024, 11:59:38 am »
......
I am asking if my approach on simpling replacing the old compiler location with the new is OK, and to remove the run time error I possible need to re-compile the wx_Widgets libraries as a I have done previously. ?? This compile took some time.!

Regards JC......
As I experienced, you can try adding -jx to make command, where x represents the thread number of gcc called simultaneously, to take full advantages of CPU and speed up compilation. I can ensure that it'll take no more than 20 minutes to finish compiling wxWidgets.
48
Have you checked if your program finishes? Open task manager and check if console runner or your program are still alive.
49
General (but related to Code::Blocks) / Re: CB C++ Issue with GNU C++ 17 (ISO)
« Last post by nenin on March 13, 2024, 07:28:09 am »
The compiler error for C++ 17 (ISO) is gone.  But I now have a run time error involving wx_Widgets.  This is attached (I hope) and is a Entry Point Not Found in a wx*.dll.
I am asking if my approach on simpling replacing the old compiler location with the new is OK, and to remove the run time error I possible need to re-compile the wx_Widgets libraries as a I have done previously. ?? This compile took some time.!

Regards JC......
At my experience all linked C++ dlls should be build with the same compiler you are using for your application. So, you have to build you version of the wxWidgets or to use the same compiler as was used for these dlls.
Also there are strong reasons to avoid  install mingw in path with spaces.
50
General (but related to Code::Blocks) / Re: CB C++ Issue with GNU C++ 17 (ISO)
« Last post by jmClifford on March 13, 2024, 04:40:13 am »
and here:
https://github.com/niXman/mingw-builds-binaries/releases
In my humble opinion proper version is
x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev0.7z
Thank you for the above information.  I have downloaded a
x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev1.7z unpacked it and loaded to
C:\Program Files\CodeBlocks\MinGW.
This is the very original location.  The compiler error for C++ 17 (ISO) is gone.  But I now have a run time error involving wx_Widgets.  This is attached (I hope) and is a Entry Point Not Found in a wx*.dll.
I am asking if my approach on simpling replacing the old compiler location with the new is OK, and to remove the run time error I possible need to re-compile the wx_Widgets libraries as a I have done previously. ?? This compile took some time.!

Regards JC......


Pages: 1 2 3 4 [5] 6 7 8 9 10