How can I include libcurl correctly using GCC (on Windows)?
My compile command includes this:
-Icurl -L"F:/GCCnew/lib/libcurl.dll"
If you use mingw gcc, then:
- First,
-L
must have a folder name, not a library name. - Second, there must be '-l' option. For example -lcurl.
- Third, -Icurl is irrelevant to your linker error
So the command to build might look like:
gcc your-file.c -o executable_name -L"F:/GCCnew/lib" -lcurl
Useful links: