I am on Windows 10 and using Atom and GCC instaed of cs50.io because I have limited internet access. I downloaded cs50.c and cs50.h and put them in the same directory as my string.c file. I compiled my code with the gcc -o string string.c command but I get this error

string.c:1:18: fatal error: cs50.h: No such file or directory compilation terminated.

I don't know why! My code is exactly the same as David's and I have the cs50.h and cs50.c files in the same directory.

  • Yes I mistyped it.... Dec 20, 2016 at 14:52

1 Answer 1


Your code may be the same as David's but your environment is (drastically) different. You will possibly (probably?) have to make adjustments to all the courseware as you go along. In the IDE50 environment (ubuntu), if you want to compile a local .h file, you would include it with #include "cs50.h", using double-quotes instead of <>. And you'll need a compiled version of cs50.c to link into your program, which I imagine would have to compiled locally as well. While you are not the very first person who has tried this (here's a similar post from Nov '15, notice the warning about cs50.h), you are an outlier. As such, you will likely find the help you need (using gcc on windows) from other online forums and sources. For instance, something like this might be a good resource. IMO this forum (and the course itself) is overwhelmingly linux-centric.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .