views:

41

answers:

1

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:

The error

The error

+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
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
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
You have to go to properties on the project and select the directory... see error message above.
Tyler Brock
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
@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
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
@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
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
@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
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