Author Topic: Codeblocks 32 bit 20.03 with mingw is broken. Doesn't find compiler and debugger  (Read 6265 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5930
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
I have 64 bit operating system, 64 bit codeblocks, 32 bit MINGW. If that matters. I tried both 32 bit GDB and 64 bit. Same result.

I think if you want to build 32bit applications under windows, you need a 32bit C::B, 32bit gcc compiler suite, and 32bit gdb.

If you want to build 64bit applications, then all the tools should be 64bit.

The internal reason is that if you want to halt the debugee when debugging, you need to call an Win32 API function from C::B, and the debugger have to catch the exception. All the process should be in same 64bit application processes or 32 bit processes.
« Last Edit: February 27, 2024, 03:32:30 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline nenin

  • Almost regular
  • **
  • Posts: 227
My application crashes when there is a lot of graphics data displayed with opengl. When I stop displaying text it doesn't crash. But debugger doesn't show any information where it crashes.

1. If you want to debug 32b code using 64b C::B you have to use fresh 64b gdb. gcc version may be different, however better dont go below 9. Sometimes it require some efforts to enforce C::B to choose gdb you want to use.
2. If you need to catch something really bad, you can link your soft with drmingw dlls, - in this case it will generate *.rpt file on run time error. In this file for code with debug info you can find source of the error. You also can install drmingw as system debugger, however I dont know how it works in case of 32b on 64b Win. I prefer to link dlls.