Recent Posts

Pages: 1 2 3 4 5 6 [7] 8 9 10
61
Using Code::Blocks / Re: Configuring project compilation (example Dislin library)
« Last post by tuchin on March 15, 2024, 09:45:11 pm »
Thanks, it worked out.
62
Plugins development / Re: Code completion using LSP and clangd
« Last post by garwin on March 15, 2024, 09:37:41 pm »
On Windows 11 opening the project file itself in Windows (not directly through Codeblocks) does not parse the project on opening. Reparsing is needed to be done manually. Doing so through Codeblocks works fine.
Steps to reproduce:
1. Codeblocks not running
2. Double-click on any project file *.cbp

On Plugin wiki https://wiki.codeblocks.org/index.php/CB_Clangd_Client the first link to the plugin repository page is not working.

For information, there is a discussion of doxygen support for Clangd - https://github.com/clangd/clangd/issues/529
63
Using Code::Blocks / Re: Debugger - Memory dump
« Last post by Pecan on March 15, 2024, 06:34:20 pm »
Good.
After a breakpoint has occurred, hover over the variable for which you want an address. If you've set the option that requires the ctrl key to be tapped, do so.
The elements of the variable should then appear in the debuggers log to copy/paste.

Depending on the GDB version being used, for the first attempt to display the expression (variable or whatever), the GDB may be quite slow. After the first display, the subsequent evaluations/displays will be much faster.
64
Using Code::Blocks / Re: Debugger - Memory dump
« Last post by Evan on March 15, 2024, 01:43:39 pm »
I got this.
65
Using Code::Blocks / Re: Configuring project compilation (example Dislin library)
« Last post by Grit Clef on March 15, 2024, 12:35:11 pm »
In that project's Build Options, use the up and down arrows in Linker Settings->Link Libraries to change their sequence.
66
Searching around, I came across a set of tools by microsoft, called powertoys, one of which is called file locksmith that seems to do exactly what i want - identify which process(es) keep a certain (or more) files locked.

I downloaded powertoys (~250MB) installed it, made sure I checked the 'run in elevated mode', and test.exe gives no damn results - locksmith cannot identify any process locking that file. However, I try to delete the file and get the error 'cannot delete file cause it's in use by another program'. If i reboot, I can delete it.

I give up for now .. can't think of anything else for the time being.
I've had good luck with SysInternals  Handles.exe finding locked files.

https://learn.microsoft.com/en-us/sysinternals/

https://learn.microsoft.com/en-us/sysinternals/downloads/handle
67
Virus protection software sometimes creates very weird bugs.
68
Searching around, I came across a set of tools by microsoft, called powertoys, one of which is called file locksmith that seems to do exactly what i want - identify which process(es) keep a certain (or more) files locked.

I downloaded powertoys (~250MB) installed it, made sure I checked the 'run in elevated mode', and test.exe gives no damn results - locksmith cannot identify any process locking that file. However, I try to delete the file and get the error 'cannot delete file cause it's in use by another program'. If i reboot, I can delete it.

I give up for now .. can't think of anything else for the time being.
69
Please try to create Project via project wizard initially (menu "File - New - Project") and then add file or files to compile into project. Then try to rebuild it.

Sorry, I was posting a reply and did not see your message in time.

I did try this just now, created a C project, and then ran the main.c file that comes to it. It compiles and runs successfully first time. Second time, I get the same error. See log: (notice the compiler is now reported, as it's a project not a single file, as someone mentioned earlier).


Code
-------------- Build: Debug in test (compiler: GNU GCC Compiler)---------------

gcc.exe -Wall -g  -c C:\tmp\askiseis\test\main.c -o obj\Debug\main.o
gcc.exe  -o bin\Debug\test.exe obj\Debug\main.o   
C:/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file bin\Debug\test.exe: Invalid argument
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))



PS - Please dont be confused by the 'tmp' directory name, it's the name of a course, it's not a 'temp' directory .. it's just a regular directory that I created.
70
OK .. I checked that tool ..

I reboot, clean machine, I create a new file, test.c.

I build and run, program compiles and runs successfully, terminal window is open (I don't close it yet).

I open up built-in Resource Monitor - screenshot here.

I see the process cb_console_runner.exe (pid=15172). Searching through handles, i see multiple entries, all same PID. To be honest, I can't fully understand handles 'do'.. All have same PID so it's sort of different references to the same process in different parts of the OS?

By the way, task manager obviously shows same process (same id of course, although i did not capture it with screenshot) - screenshot here.

Now, I close the terminal window, and as expected the process disappears from task manager, and in Resource Monitor it shows as 'terminated' (screenshot here - also grayed out, disabled) and when I click on the processes window, it kind of 'refreshes' and the process completely disappears from the processes list. Sorting with PIDs, there is no process with pid 15172 anymore. I can't see anything on bottom window with 'handles' either..

Now, I try to build & run again, only to get the same error:


Code
-------------- Build file: "no target" in "no project" (compiler: unknown)---------------

gcc.exe   -c C:\Users\thomas\test.c -o C:\Users\thomas\test.o
gcc.exe  -o C:\Users\thomas\test.exe C:\Users\thomas\test.o   
C:/CodeBlocks/MinGW/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot open output file C:\Users\thomas\test.exe: Invalid argument
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
2 error(s), 0 warning(s) (0 minute(s), 0 second(s))

Interestingly, I try to manually delete .exe file, and I get "action can't be completed because the file is open in another program".

I close CodeBlocks (just in case) - same message, action can't be completed...

In the past, I could delete .exe files manually ...


Also - irrelevant probabaly - but I performed a CHKDSK on windows, it found that it needed to fix some errors, rebooted, performed thorough CHKDSK, it said it fixed stuff, nothing changed ..


I am searching on how to find that 'other program' that holds a lock on the .exe file - but everything points to checking task manager, killing the process etc - but I cant find any process that deals with it once the terminal window is closed. Process Monitor has no handles on previous PID 15172 ... all processes seem legit and irrelevant to that previous executable ...

I 'm lost... any ideas would be greatly appreciated ...

 

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