Code::Blocks Forums
User forums => Help => Topic started by: Robt800 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
-
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?
-
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.
-
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
-
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.
-
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
-
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/ (http://mingw.org/)
mingw64 has more complete set of windows headers because they are not as strict on code added.
https://mingw-w64.org (https://mingw-w64.org)
Tim S.
-
Thanks I will have a look at those tomorrow
Rob