0

I have installed code blocks on Windows 10, before that I installed GCC Cygwin compiler. In Settings > Toolchain executables section I set up C compiler, C++ compiler, linker to dynamic libs to use gcc.exe, the compiler's directory is set as C:\cygwin64.

I tried to run a dummy hello world program to make sure it works but got the following error:

||=== Build: Debug in dummy2 (compiler: Cygwin GCC) ===|

\Users\abc\OneDrive\ミミクミケ ムath\dummy2\main.c"||No such file or directory|

||error: no input files|

||=== Build failed: 2 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|

I used to use min gw compiler and it worked fine, but once I switched to cygwin it started to throw errors.

It looks like this part of the file directory is garbled, cant figure out why.

OneDrive\ミミクミケ ムath\

Please let me know what can be a problem here.

Cheers.

  • 2
    I didn't work with Cygwin too much, but I think it expects paths like `/cygdrive/c/Users/abc/.../main.c`. Not sure if there's an easy way of making it work with CB. Is there a reason you don't want to use MinGW? – HolyBlackCat Jul 07 '20 at 17:09
  • I started a new course on Udemy on advanced C language, and its suggesting to use cygwin, maybe there is no actual difference, but I just followed the instructions. – dariahiguchi Jul 07 '20 at 17:18
  • Do they explain why they suggest it? – HolyBlackCat Jul 07 '20 at 17:21
  • Not really, it just says that throughout this course we will use cygwin compiler, but looks like there is a difference, looks like MinGW is used for compiling for Windows, but cygwin is compiling for cygwin, as it says here https://stackoverflow.com/questions/771756/what-is-the-difference-between-cygwin-and-mingw – dariahiguchi Jul 07 '20 at 17:29
  • 1
    It shouldn't matter which one you use. But MinGW shipped with CB is outdated; if this becomes an issue, you can get an new one from MSYS2. – HolyBlackCat Jul 07 '20 at 17:42
  • Being in the OneDrive folder is probably part of your problem. Test using a folder that is in the root of c: and use a path like explained in the first comment. – drescherjm Jul 07 '20 at 18:05
  • You may also wish to consider `WSL2` (Windows Subsystem for Linux) version 2 under win10. It allows you to run a real ubuntu linux kernel under a special lightweight virtual machine. It is fully supported by Microsoft. Then, you have a real linux environment without the hassle of dual boot. After booting the ubuntu linux kernel, you have a [more or less] 100% ubuntu distro and can install the standard ubuntu packages (e.g. `gcc`). – Craig Estey Jul 07 '20 at 18:08
  • Cygwin programs expect (and some of them require) that file names are in unix format. The minGW programs will accept either linux style or windows style paths. You get messed up file names because some of the back-slashes are followed by characters that get interpreted as unicode characters. Note that some windows accept an intermediate format where the back-slashes in a windows path are replaced by forward slashes. You can try using paths like that. – Doug Henderson Jul 07 '20 at 22:59
  • 1
    As suggested in the 1st and 6th comment I tried to use the root directory and put the files inside C:\cygwin64\lib and it worked! Thanks – dariahiguchi Jul 08 '20 at 04:31

0 Answers0