Code::Blocks not working with MSYS2 MinGW due to path problems

2021-10-12T16:29:46

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

About “Code::Blocks not working with MSYS2 MinGW due to path problems” questions

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:\
I had a year old version of MSYS2/MinGW that was using PyInstaller with Python3.7 to compile a C GTK application in Windows (python was needed for a plotting script) and everything worked fine until
I was wondering if there is a way in MSYS2 to specify the base MinGW/MinGW64 directory? In MSYS (i.e., MSYS-1), after installing MSYS, it knows that the directory structure is, e.g., /c/mingw/msys...
I am trying to use gtkmm3 in eclipse on windows with Mingw-w64. I have installed MSYS2 and development tools including pkg-config under Mingw-w64. I have added the mingw and msys2 bin directories t...
Here is my project: project structure: test/ CmakeList.txt main.cpp external/ cppzmq/... cppzmq from https://github.com/zeromq/cppzmq Cmake: cmake_minimum_required(VERSION 3.17)
On Windows I'm trying to use MSYS2 to install Cmake and the FLTK library and from what I found online I should open a mingw64 shell window where I should install Cmake with the command: pacman -S m...
I am using Code::Blocks (ver. 13.12) with MinGW (ver. 4.7.1) on 32-bit Windows 7. While trying to build my project I get the following error after the compilation step: Execution of 'mingw32-g++....
I installed pip on MSYS2 using the following command in the MSYS2 shell: pacman -S mingw-w64-x86_64-python-pip (web page for the package: https://packages.msys2.org/package/mingw-w64-x86_64-python-...
Is there a way that I can configure MSYS2 so that I do not have to always pass in CPPFLAGS=-I/mingw64/include LDFLAGS=-L/mingw64/lib to my compiler?
I have minGW gcc installed on my computer from previous projects, and I have recently installed Msys2 so I could develop with GTK. Is it bad to have MinGW and a instance of MinGW on Msys2 installed...

Copyright License:Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.