Recent Posts

Pages: 1 2 3 [4] 5 6 7 8 9 10
31
Using Code::Blocks / Howto use Hexdit search
« Last post by Evan on March 14, 2024, 10:31:29 am »
I use Hexedit very often, but I have not yet figured out how to use the search feature to find anything?

Thanks in advance.
32
Using Code::Blocks / Debugger - Memory dump
« Last post by Evan on March 14, 2024, 10:29:31 am »
Happy Code::Blocks user here running Linux Mint LMDE programming in C99:

When I use Memory dump, I have to type the memory address I want look at in the Memory dump window.

How can I copy/paste the memory address, from the Watch window to the Memory dump window?

Thanks in advance.

33
Have you tried pressing a key to close the console?

The "No project/No target/Unknown compiler" message has no sense, and
Code
ld.exe||cannot open output file C:\tmp\test.exe Invalid argument|
means something is corrupted.

Go to Settings->Compiler->Other settings and select "Full command line" in Compiler logging. Then do a full rebuild and post the result here in code tags (the # above the edit window).
34
Have you checked if your program finishes? Open task manager and check if console runner or your program are still alive.

Hello, and thanks for your input.

Yes, it does finish. When I run it the first time, I do see cb_console_runner.exe in tasks, when i close the window (click x on console window showing output), it disappears from task manager. I have also checked through PowerShell, sorting all processes by time - again same behaviour, I see the processes and I stop seeing them when I close the window. The program seems to finish, like it always did when I simply closed the terminal window that opens up. Also, codeblocks compile/run/compile&run buttons are disabled when terminal window is still open.

However, upon closing window, codeblocks re-enables buttons, and although I don't see the process anymore in Windows, compile&run shows the error I pointed out in my first post. I have to go and manually delete .exe file in order to be able to compile&run again.
35
Plugins development / Re: Code completion using LSP and clangd
« Last post by garwin on March 14, 2024, 07:42:09 am »
@garwin

Remove the space(s) in"....mingw 13.1/....

Thanks a lot, that's it and adding everything to the search directory. I usually do not use spaces but for whatever unknown reasons I did it for the compiler version.
36
General (but related to Code::Blocks) / Re: CB C++ Issue with GNU C++ 17 (ISO)
« Last post by jmClifford on March 14, 2024, 12:31:15 am »
Hi. Thanks for the help.
I have MinGW 13.2 working (after 2 X 1 hour builds; release and debug).
The "To_Do" program operates even without nominating GNU C++ 17.
I can access the items in the <filesystem> now, which I was failing on before.  This is mainly file/folder exits().

I will consider the -jx option (wrt threads) next time.  Or maybe sooner, since I am interested in this for myself (my programming).

Regards JC......
37
Plugins development / Re: Code completion using LSP and clangd
« Last post by Pecan on March 14, 2024, 12:18:41 am »
@garwin

Remove the space(s) in"....mingw 13.1/....
In other words, rename "Mingw 13.1" to Mingw13.1 (no space).

Do not use spaces in file or path names.
Bet it'll work after removing the spaces.

Important:
After removing the spaces in the paths,
delete the .cache directory in your project folder.
Delete the compile_commands.json file in your project folder before you load the project again.
This has to be done only once to remove the path names stored with spaces.

The reason why no spaces allowed. Clangd and friends are cross OS tools. And Unix derived tools cannot have spaces in files and paths.
38
Plugins development / Re: Code completion using LSP and clangd
« Last post by garwin on March 13, 2024, 10:25:26 pm »
@Pecan

Find something but I do not know how to solve it. It mark MinGW directories as non-existent but they exist.
Trying run command:
Code
clangd --check=C:\Users\tnadrchal\Documents\_Ostatni\C++\TES
TS\_WORKING\TEST_CLANGD\TEST_CLANGD\main.cpp

Code
C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\Clangd>clangd --check=C:\Users\tnadrchal\Documents\_Ostatni\C++\TES
TS\_WORKING\TEST_CLANGD\TEST_CLANGD\main.cpp
I[22:18:09.957] clangd version 18.1.1
I[22:18:09.960] Features: windows
I[22:18:09.960] PID: 24384
I[22:18:09.961] Working directory: C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\Clangd
I[22:18:09.962] argv[0]: clangd.exe
I[22:18:09.963] argv[1]: --check=C:\Users\tnadrchal\Documents\_Ostatni\C++\TESTS\_WORKING\TEST_CLANGD\TEST_CLANGD\main.cpp
I[22:18:09.973] Entering check mode (no LSP server)
I[22:18:09.974] Testing on source file C:\Users\tnadrchal\Documents\_Ostatni\C++\TESTS\_WORKING\TEST_CLANGD\TEST_CLANGD\main.cpp
I[22:18:09.978] Loading compilation database...
I[22:18:09.995] Loaded compilation database from C:\Users\tnadrchal\Documents\_Ostatni\C++\TESTS\_WORKING\TEST_CLANGD\TEST_CLANGD\compile_commands.json
I[22:18:10.001] Compile command from CDB is: [C:/Users/tnadrchal/Documents/_Ostatni/C++/TESTS/_WORKING/TEST_CLANGD/TEST_CLANGD] "C:\\Users\\tnadrchal\\Documents\\_Ostatni\\C++\\CodeBlocks\\Clangd\\g++.exe" --driver-mode=g++ -Wall -fexceptions -v -g "-IC:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include" "-IC:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++" "-IC:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++/13.1.0" "-IC:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0/include" "-IC:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0" "-IC:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32" -IC:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/Clangd/include -c -o obj/Debug/main.o "-resource-dir=C:\\Users\\tnadrchal\\Documents\\_Ostatni\\C++\\CodeBlocks\\lib\\clang\\18" -- "C:\\Users\\tnadrchal\\Documents\\_Ostatni\\C++\\TESTS\\_WORKING\\TEST_CLANGD\\TEST_CLANGD\\main.cpp"
I[22:18:10.005] Parsing command...
clang version 18.1.1
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\Clangd
I[22:18:10.030] internal (cc1) args are: -cc1 -triple x86_64-pc-windows-msvc19.33.0 -fsyntax-only -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name main.cpp -mrelocation-model pic -pic-level 2 -mframe-pointer=none -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -gno-column-info -gcodeview -debug-info-kind=constructor -fdebug-compilation-dir=C:/Users/tnadrchal/Documents/_Ostatni/C++/TESTS/_WORKING/TEST_CLANGD/TEST_CLANGD -v -fcoverage-compilation-dir=C:/Users/tnadrchal/Documents/_Ostatni/C++/TESTS/_WORKING/TEST_CLANGD/TEST_CLANGD -resource-dir "C:\\Users\\tnadrchal\\Documents\\_Ostatni\\C++\\CodeBlocks\\lib\\clang\\18" -I "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include" -I "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++" -I "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++/13.1.0" -I "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0/include" -I "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0" -I "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32" -I C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/Clangd/include -internal-isystem "C:\\Users\\tnadrchal\\Documents\\_Ostatni\\C++\\CodeBlocks\\lib\\clang\\18\\include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 10.0/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 9.0/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 8/VC/include" -internal-isystem "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include" -Wall -fdeprecated-macro -ferror-limit 19 -fmessage-length=120 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.33 -std=c++14 -fskip-odr-check-in-gmf -fdelayed-template-parsing -fcxx-exceptions -fexceptions -no-round-trip-args -faddrsig -x c++ "C:\\Users\\tnadrchal\\Documents\\_Ostatni\\C++\\TESTS\\_WORKING\\TEST_CLANGD\\TEST_CLANGD\\main.cpp"
I[22:18:10.034] Building preamble...
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/Clangd/include"
ignoring nonexistent directory "C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\lib\clang\18\include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"
#include "..." search starts here:
#include <...> search starts here:
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++/13.1.0
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0/include
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32
End of search list.
I[22:18:10.216] Built preamble of size 342244 for file C:\Users\tnadrchal\Documents\_Ostatni\C++\TESTS\_WORKING\TEST_CLANGD\TEST_CLANGD\main.cpp version null in 0.18 seconds
I[22:18:10.219] Indexing headers...
E[22:18:10.228] [pp_file_not_found] Line 1: in included file: 'bits/c++config.h' file not found
I[22:18:10.230] Building AST...
clang version 18.1.1
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\Clangd
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++/13.1.0"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0/include"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/Clangd/include"
ignoring nonexistent directory "C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\lib\clang\18\include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"
#include "..." search starts here:
End of search list.
clang version 18.1.1
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\Clangd
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++/13.1.0"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0/include"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32"
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/Clangd/include"
ignoring nonexistent directory "C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\lib\clang\18\include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"
#include "..." search starts here:
End of search list.
ignoring nonexistent directory "C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/Clangd/include"
ignoring nonexistent directory "C:\Users\tnadrchal\Documents\_Ostatni\C++\CodeBlocks\lib\clang\18\include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 10.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 9.0/VC/PlatformSDK/Include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/include"
ignoring nonexistent directory "C:/Program Files/Microsoft Visual Studio 8/VC/PlatformSDK/Include"
#include "..." search starts here:
#include <...> search starts here:
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/include/c++/13.1.0
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0/include
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32/13.1.0
 C:/Users/tnadrchal/Documents/_Ostatni/C++/CodeBlocks/MinGW 13.1/lib/gcc/x86_64-w64-mingw32
End of search list.
E[22:18:10.272] [no_member] Line 5: no member named 'cout' in namespace 'std'
E[22:18:10.273] [no_member] Line 5: no member named 'endl' in namespace 'std'
I[22:18:10.274] Indexing AST...
I[22:18:10.274] Building inlay hints
I[22:18:10.275] Building semantic highlighting
I[22:18:10.275] Testing features at each token (may be slow in large files)
I[22:18:10.278] All checks completed, 3 errors


Finding this discussion but quite late here, will look tomorrow.
This one - https://github.com/clangd/vscode-clangd/issues/393
And especially this one - https://clangd.llvm.org/faq#how-do-i-fix-errors-i-get-when-opening-headers-outside-of-my-project-directory - but how can I do it in codeblocks?
39
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.
40
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?
Pages: 1 2 3 [4] 5 6 7 8 9 10