I have a problem in 'c' language inside compiling with gcc.
This is code inside my hello.c file
#include "cs50.h"
#include <stdio.h>
int
main(void){
string name = "David";
printf("O hai, %s!\n", name);
}
This is command under bash (Cygwin)
gcc -o hello hello.c -lc50
I get this error:
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/id: cannot find -lcs50
collect2: Id returned 1 exit status
Please help me where i am wrong?
To be able to use -lcs50
, you'll first need to build that library (cs50
) from its source code (cs50.c
).
Alternatively, you could simply:
gcc -o hello hello.c cs50.c
assuming cs50.c
doesn't have other dependencies.