I have a problem in ‘c’ language inside compiling with gcc.
- I am using “Cygwin” with (gcc-core, gcc-g++, gdb, make & other supportive packages) inside windows xp.
- I installed “Cygwin” on this path “C:\Cygwin\”.
- My home directory: “C:\Cygwin\home\Bhanu Pratap”
- I copied “cs50.h” and “cs50.c” inside my working directory which is also under “C:\Cygwin\home\Bhanu Pratap”.
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:
assuming
cs50.cdoesn’t have other dependencies.