Hey guys, I was wondering if you would be able to help me use libcurl within Visual Studio to resolve the errors in the image below:
+1
A:
It looks like you need to update Visual Studio's configuration to include the directories where you've installed cURL. VS has directories for both Include files and libraries -- if memory serves, you'll have to add both.
Jerry Coffin
2010-08-31 15:47:06
I've tried to do this in VSC++ and eclipse for hours... can't get the compiler to find the libraries. Pulling my hair out, should be relatively easy.
Tyler Brock
2010-08-31 16:11:14
In VS 2008, it's: Tools -> Options -> Projects and Solutions -> VC++ Directories, then select "Include Files", add the directory, and select "Library Files", and add that directory. I think it's about the same in 2010, but don't have access to it at the moment to check.
Jerry Coffin
2010-08-31 16:31:57
You have to go to properties on the project and select the directory... see error message above.
Tyler Brock
2010-08-31 16:59:36
I've added the include directory to the include path, and the library directory to the library path in the project properties... no luck.
Tyler Brock
2010-08-31 17:05:14
@Tyler: actually you *have* apparently had *some* luck: you're getting unresolved externals, which means it *is* finding the include directory and compiling the code. It's only linking to the library that's failing. I'd guess your directories are set up correctly (for both include and library files). Now you need to tell your project to actually link the cURL library (also make sure you've *built* the cURL library itself).
Jerry Coffin
2010-08-31 17:48:37
Very cool, if i downloaded it, would I still have to compile it? How do I tell VC++ to link to the library itself? Thanks for all the help!
Tyler Brock
2010-08-31 22:15:14
@Tyler: Offhand I'm not sure with cURL (haven't used it in a couple years and don't remember) but having to compile the library is pretty common. Telling VC++ to link that library requires adding the library name to the "additional dependencies" in Linker -> Input of the project properties.
Jerry Coffin
2010-08-31 23:07:19
GOT IT! Now it's just saying it can't find curllib.dll... i'm pretty close, any ideas! You are helping a ton.
Tyler Brock
2010-09-01 00:08:04
@Tyler: I'd just copy curllib.dll into the directory along with the executable. Assuming your creating a 32-bit executable, that'll be in either the `debug` or the `release` directory below where you created your project.
Jerry Coffin
2010-09-01 03:42:50
That totally worked, and it complained about more libs, so I added all the ones that came with the libcurl download, and then it finally complained about libsasl. Bummer. I have no idea where to get that and google yielded many people having the same issue.
Tyler Brock
2010-09-01 13:26:44