Thread: Trying to include a libary in Visual Studio

  1. #1
    Registered User
    Join Date
    Aug 2007
    Location
    U.K.
    Posts
    148

    Trying to include a libary in Visual Studio

    Hi there,

    I'm trying to use cURL in a C++ app, but being new to using libraries, I've having trouble in setting up my program.

    I've spent some time following the guides in Google, but they all seem to first show how to create your own library, I want to use the static (do want to use static) cURL one, not one I made myself.

    First I'm creating a new project (called 'curl'), then I add a new source file (called main.cpp):

    Into main.cpp I enter the code I found HERE.

    Screenshot

    If I build the project now I get:
    ------ Build started: Project: curl, Configuration: Debug Win32 ------
    Compiling...
    main.cpp
    c:\documents and settings\administrator\my documents\visual studio 2005\projects\curl\curl\main.cpp(12) : fatal error C1083: Cannot open include file: 'curl/curl.h': No such file or directory
    Build log was saved at "file://c:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\curl\curl\Debug\BuildLog.htm"
    curl - 1 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    So I downloaded I downloaded curl-7.20.0.zip and extracted it.

    ScreenShot

    This is where I'm getting stuck. One of the guides suggests saving all my libraries into a separate folder in C:\libs so that the all the libraries in there will be accessible to all future VStudio projects (once I set it up), but I just want to add and use cURL in this particular project only.

    So can anyone explain to me in simple steps how I can use the cURL library? Like I mentioned, I want to use the static library so that all the required code will be included in the final program's .exe.

    Never used a library before, so if you can help me it would be really appreciated.

    Many thanks for you help!

  2. #2
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    Did you follow this tutorial on the libcurl site?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. LDAP Query
    By Travoiz in forum C++ Programming
    Replies: 0
    Last Post: 08-13-2009, 02:58 PM
  2. Buidl Library with ./configure script
    By Jardon in forum C Programming
    Replies: 6
    Last Post: 07-24-2009, 09:36 AM
  3. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  4. OpenGL prob
    By HQSneaker in forum Game Programming
    Replies: 18
    Last Post: 06-22-2006, 12:55 PM
  5. Using 'if' with char arrays or string objects
    By c++_n00b in forum C++ Programming
    Replies: 36
    Last Post: 06-06-2002, 09:04 PM