libcs50 icon indicating copy to clipboard operation
libcs50 copied to clipboard

Include errors detect , cannot open source file "cs50.h"

Open Foz1984 opened this issue 1 year ago • 4 comments

while I am writing code #include <cs50.h>, it gives error "Include errors detect , cannot open source file "cs50.h".

Foz1984 avatar May 13 '24 20:05 Foz1984

are you on your local ide ? If yes, are you using windows, macos linux ? (next time, please ask on one of the other online communities )

Landixbtw avatar May 15 '24 18:05 Landixbtw

while I am writing code #include <cs50.h>, it gives error "Include errors detect , cannot open source file "cs50.h".

I guess it might be helpful for you https://www.youtube.com/watch?v=ad0HHLldK-c

nandarwin19 avatar May 30 '24 04:05 nandarwin19

Are you logged in as root? Because it causes problems when logged in as root because the 'root' user isn't told to that the "cs50.h" is a built-in library. You may download the source code of cs50 and put the files "cs50.h" and "cs50.c" to a directory on your workspace . To include it , type :

#include "yourdir/cs50.h"
//Note: #include <example.h> means built-in header ,  and #include "example.h" means user-written directory.

afifafifafifafifali avatar Aug 02 '24 08:08 afifafifafifafifali

Question is, how do I know everything of this. Answer: I'm a Operating System developer . It is a hard project and includes the least used things in the C programming language . E.g. Writing your own standard header files.

afifafifafifafifali avatar Aug 02 '24 08:08 afifafifafifafifali