Author Topic: Debugging issues  (Read 621 times)

Offline Robt800

  • Single posting newcomer
  • *
  • Posts: 4
Debugging issues
« on: June 22, 2019, 06:28:57 pm »
Hi, I'm really quite new to programming (at least C - I come from a PLC background) - hence I've only been using code blocks a little while.

I've configured it to use cygwin on a windows 10 machine and everything is generally good.  However when I debugg I get the following error message appearing:

Cannot open file: /cygdrive/c/Personal/Learning/Programming/C_Language/Programs/Code_Chalenges/main.c

Now it still allows me to debugg - but it is annoying and I note that the compiler seems to freeze quite a bit and I have to stop the windows process 'cb_console_runner.exe' to get the compiler to re-run.

Any help/ pointers would be appreciated
Thanks
Rob

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2464
Re: Debugging issues
« Reply #1 on: June 23, 2019, 10:38:15 pm »
Quote
I have to stop the windows process 'cb_console_runner.exe' to get the compiler to re-run.
Is your program exiting properly?
Can you reproduce this with a minimal hello world example?
The console runner does only run as long as your program runs.
What version of codeblocks are you using?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11939
    • Travis build status
Re: Debugging issues
« Reply #2 on: June 24, 2019, 08:20:46 pm »
This is a known problem, unfortunately no one using cygwin is providing patches to fix this problem.
The best workaround is to not use cygwin, but just some other gcc port like the mingw or mingw-w64 ones.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Robt800

  • Single posting newcomer
  • *
  • Posts: 4
Re: Debugging issues
« Reply #3 on: June 24, 2019, 08:57:07 pm »
Hi BlueHazzard - thanks for the reply.  It exits properly sometimes...
Absolute minimal code will create the fault.  Code blocks is version 17.12

oBFusCATed - great...
Is there really any difference (advantages?) to using cygwin vs mingw?

Thanks

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6613
    • My Best Post
Re: Debugging issues
« Reply #4 on: June 24, 2019, 09:40:13 pm »
Hi BlueHazzard - thanks for the reply.  It exits properly sometimes...
Absolute minimal code will create the fault.  Code blocks is version 17.12

oBFusCATed - great...
Is there really any difference (advantages?) to using cygwin vs mingw?

Thanks

If you are porting Linux/Unix code to Windows cygwin GCC is better/easier for networking related stuff.

You might wish to look at MSys2; but, till you state why you are using CygWin it is hard to help you.

Code::Blocks on windows is normally used with MinGW GCC; MinGW64 is better than mingw.org GCC in my opinion.

NOTE: Cygwin has option to install mingw GCC compiler; and, that might be a thing to try.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Robt800

  • Single posting newcomer
  • *
  • Posts: 4
Re: Debugging issues
« Reply #5 on: June 25, 2019, 11:38:38 am »
Hi stahta01,

tbh I am teaching myself C programming.  I am a PLC programmer guy by trade but wanted to learn another language which may help my career in the future (embedded software??)

Hence teaching myself I don't really understand the difference between the compilers.

I do have a short term goal in mind - writing a C program that will clone a log file on a siemens HMI (that runs windows embedded) and copy it to a network location.

So I suppose any pointers to main differences (or where I can learn about them) would be much appreciated.

Thanks
Rob

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6613
    • My Best Post
Re: Debugging issues
« Reply #6 on: June 25, 2019, 01:40:28 pm »
I would use either an mingw.org or mingw64 GCC Compiler/Toolchain in your case.

mingw.org is 32 bit only and mingw64 is both 32 bit and 64 bit.

mingw.org is older and more strict on code added to their system. http://mingw.org/
mingw64 has more complete set of windows headers because they are not as strict on code added.
https://mingw-w64.org

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline Robt800

  • Single posting newcomer
  • *
  • Posts: 4
Re: Debugging issues
« Reply #7 on: June 25, 2019, 09:52:28 pm »
Thanks I will have a look at those tomorrow

Rob