Prerequisites for build environment (mine is VM with Windown XP guest)
- Clone repository or download src from it first
- Visual Studio express (v. 2008 is just fine which works on XP)
- CMake
- curl
- Install studio (to C:\SDKS\v9.1)
- Install cmake (to C:\SDKS\cmake)
- Extract curl (to C:\SDKS\curl)
- Compile curl with cmake
- extract archive, rename directory
- set all environment variables for VS by running
C:\SDKS\v9.1\VC\vcvarsall.bat
in command prompt - change dir to C:\SDKS\curl
- Continue with variants bellow 2a or 2b
C:\SDKS\curl>cmake -DCURL_STATICLIB=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=MinSizeRel -G "NMake Makefiles"
C:\SDKS\curl>nmake libcurl
- C:\SDKS\curl>cmake -DCURL_STATICLIB=ON -DBUILD_SHARED_LIBS=OFF -G "Visual Studio 9 2008" .
- (C:\SDKS\curl>cmake -DCURL_STATICLIB=ON -DBUILD_SHARED_LIBS=OFF -G "Visual Studio 10 2010" .)
- Open ALL_BUILD.vcxproj in Visual Studio
- Right click on project "libcurl" and select "Set as StartUp Project"
- From Build type select MinSizeRel
- Build libcurl from menu "Build"
- In output you should find Build: # succeeded string and above that location of lib to remember:
C:\SDKS\curl\lib\MinSizeRel\libcurl.lib
C:\SDKS\cht\build>cmake -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 9 2008" ..\cht\src
- Open CHT.sln in VS
- Right click on project "cht" and select "Set as StartUp Project"
- From Build type select Release
- Build it
- Create empty console app in VS
- Add files cht.c and rlutil.h. Add additioal directory include
C:\SDKS\curl\include
by right rigth clicking on project, Properties. Both showned on picture. - Linking will failt if you build project now. You should setup linker with both: Additional Dependencies: "ws2_32.lib wldap32.lib"
- and Preprocessor Definitions set: "CURL_STATICLIB" If error about LIBCMT.lib appears, change Project + Properties, C/C++, Code Generation, Runtime Library. Set as "/MT". But this only show problem with step 2a, use step 2b instead. Better to leave it /MD. Amd give more RAM to VM.