I installed the Code::Blocks on a Windows 10 PC using the downloaded binary codeblocks-20.03-setup.exe. I adjusted the settings to point to my Msys2 MinGW compiler C:\msys64\mingw64
and debugger C:\msys64\usr\bin\gdb.exe
. I then created a project with the default console app in c using Code::Blocks. It can compile and run using Code::Blocks.
When I debug it it fails. Code::Blocks gives an error:
Cannot open file: /c/GitLab/debugging-c-code/Exercise Files/Ch02/02_01/02_02_ide/main.c
At /c/GitLab/debugging-c-code/Exercise Files/Ch02/02_01/02_02_ide/main.c:6
The main.c file is open in Code::Blocks. I assume the /c/
vs c:\
part is the problem. I have no idea how to resolve the problem for Code::Blocks.
My Setup:
[..]which gcc
gcc is an external : C:\msys64\usr\bin\gcc.exe
[...]gcc --version
gcc (GCC) 9.1.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[...]which gdb
gdb is an external : C:\msys64\usr\bin\gdb.exe
[...]gdb --version
GNU gdb (GDB) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Copyright License:
Author:「Gerhard」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/69537333/codeblocks-not-working-with-msys2-mingw-due-to-path-problems