• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

AUTHORSH A D07-Mar-2017277 1412

LICENSEH A D07-Mar-20171.1 KiB2217

README.win32H A D07-Mar-201711.3 KiB238168

TODOH A D07-Mar-2017203 54

guide.texH A D07-Mar-201726.8 KiB707591

README.win32

1Read the README file first.
2
3As of version 0.6.0 curlpp has been built and run on win32.
4
5Information contained in this file does not apply to cygwin builds.
6
7curlpp has been tested on
8Microsoft Visual C++ 7.1 (2003), (by Giuseppe "Cowo" Corbelli)
9Microsoft Visual C++ 8.0 (2005), (by Andrei Korostelev)
10Microsoft Visual C++ 9.0 (2008), (by Piotr Dobrogost)
11but any modern C++ compiler should do the job.
12
13BUILDING CURLPP WITH MSVC
14-------------------------
15
16BUILDING CURLPP
17
18You can build curlpp in three different ways
19
20A. from within MS Visual Studio IDE
21B. using msbuild tool and solution files
22C. using namke and makefile
23
24
25A. and B.
26
27	In case of A. and B. first you have to create solution files for your version of MS Visual Studio.
28	To do this use win32\create-vc-solution.bat	batch file with one of the following parameters:
29	7.1, for Visual Studio 2003
30	8, for Visual Studio 2005
31	9, for Visual Studio 2008
32	This batch file needs sed to be run successfully. You can download sed for win32 platform here
33	http://gnuwin32.sourceforge.net/packages/sed.htm
34
35
36A. Building from within IDE
37
38    Choosing configuration
39
40        Choose configuration you would like to build. What configuration you want depens on three aspects.
41        1. Weather you want to build dynamic library (dll) or static library (lib).
42           Choose configuration with DynamicLib or StaticLib prefix.
43        2. Weather you want to build debug or release version of the library.
44           Choose configuration with Debug or Release infix.
45        3. Weather you want static runtime library (RTL) to be used by curlpp or dynamic one.
46           Choose configuration with StaticRTL or DynamicRTL suffix.
47
48        Names' suffixes of output .lib and .dll files depend on the all three choices.
49
50        MTd - dynamic, debug, static RTL
51        MT -  dynamic, release, static RTL
52        MDd - dynamic, debug, dynamic RTL
53        MD -  dynamic, release, dynamic RTL
54
55        staticMTd - static, debug, static RTL
56        staticMT -  static, release, static RTL
57        staticMDd - static, debug, dynamic RTL
58        staticMD -  static, release, dynamic RTL
59
60        We will refer to these suffixes and types of libraries as "build category" further in this document.
61
62    Setting include directory
63
64        If you are building curlpp using the original directory structure then you don't need to set value of user macro
65        CURLPP_INCLUDE_PATH (by default ".\include"). If however you modified the original directory structure you have
66        to set value of this macro to the path, where you have curlpp source files.
67
68	Setting output directory
69
70		The output files will be placed in a directory set in CURLPP_LIB_PATH user macro (by default ".out\lib").
71
72
73B. Building using msbuild
74
75    Open a command prompt and change folder to the root of curlpp tree.
76
77    set LIBCURL_PATH=/where/curl/is/installed
78    set OPENSSL_PATH=/where/openssl/is/installed (only if you have libcurl with ssl support and ssl installed)
79    msbuild curlpp.sln /t:Rebuild /p:Configuration=<Configuration>
80        where <Configuration> is one of
81        - DynamicLibDebugDynamicRTL
82        - DynamicLibDebugStaticRTL
83        - DynamicLibReleaseDynamicRTL
84        - DynamicLibReleaseStaticRTL
85        - StaticLibDebugDynamicRTL
86        - StaticLibDebugStaticRTL
87        - StaticLibReleaseDynamicRTL
88        - StaticLibReleaseStaticRTL
89
90    Output files will be placed in a directory set in CURLPP_LIB_PATH.
91
92    Any of DynamicLib* configurations will build a .dll library file and a .lib library import file.
93    Any of StaticLib* configurations will build the .lib static (inline) library.
94	Any of *Debug* configurations will in addition build a .pdb Program Database file.
95
96
97C. Building using nmake
98
99	Open a command prompt and change folder to the root of curlpp tree.
100	Run nmake /f makefile with the following parameters
101	BUILD_CFG=[dynamic|static]-[debug|release]
102	RTLIB_CFG=[dynamic|static]-[debug|release]
103	LIBCURL_CFG=[dynamic|static]-[debug|release]
104
105	All options are optional.
106	Default for BUILD_CFG is dynamic-release.
107	Default for others is the value of BUILD_CFG.
108	Edit the LIBCURL_PATH or set LIBCURL_PATH envvar!
109
110
111NOTES
112
113    Linking with libcurl
114
115    All versions of this library need libcurl (c library) include files to compile and lib file to link successfully.
116    To build curlpp you first have to set value of LIBCURL_PATH user macro to your installation of libcurl.
117    This macro is used in the project file for VC9 to find include and lib files of libcurl.
118    Steps to set user macro. Select View/Property Manager, double-click curlpp property sheet, go to
119    Common Properties/User Macros/, double-click name of macro you want to modify, modify it and click OK.
120    Filename of libcurl's lib file should be in the form libcurlX.lib where X denotes build category chosen for curlpp.
121    (see Linking with RTL)
122    If it has different name you have to change .lib filename in
123    Project properties\Librarian\Additional Dependencies (when building static library)
124    or
125    Project properties\Linker\Input\Additional Dependencies (when building dynamic library).
126
127
128    Linking with static libcurl
129
130    If you are not going to use libcurl as a dll and you would like to include it into your library/executable by
131    linking to static version of libcurl you have to define preprocessor symbol CURL_STATICLIB. You can do it in
132    Project/Properties/C/C++/Preprocessor/Preprocessor Definitions.
133    By default all StaticLib* configurations define this symbol. If for some reason you would like to build static
134    curlpp library which links do dynamic libcurl library you have to remove CURL_STATICLIB define.
135
136
137    Linking with RTL
138
139    You have to link with libcurl which uses RTL in the same way as you are going to use RTL in curlpp lib.
140    Refering to build categories defined earlier in section "Choosing configuration" both libcurl and curlpp
141    must have the same build category.
142    If you are going to use dynamic RTL in curlpp (MD[x]), use libcurl which also uses dynamic RTL (MD[x]).
143    If you are going to use static RTL in curlpp (MT[x]), use libcurl which also uses static RTL (MT[x]).
144    You can use debug build of libcurl (MDd or MTd) in the release build of curlpp (MD or MT) and
145    you can use release build of libcurl (MD or MT) in the debug build of curlpp (MDd or MTd).
146    However you shouldn't do this.
147
148	Building self-contained version of the library
149
150	curlpp is mostly a template library. For this reason during build of it, only non template entities are placed in the
151	.lib and .dll files. Most of the library's features used in your application causes code generation during compilation
152	of _your project_ and the code is placed in your executable. This is often not desirable. If you want to build
153	the curlpp as self-contained library (one which has all code called by clients in its .lib and .dll files) you can
154	define preprocesor symbol CURL_SELF_CONTAINED. In this case curlpp uses explicit template instantiation (all such
155	instantiantions are placed in separte .ins files) to force generating code into .lib and .dll files. You have to
156	define this preprocesor symbol during build of your application to avoid including templates' definitions as they
157	are not needed in this phase. If you get linker errors connected with curlpp features when using self-contained
158	version of the library it's because there are some missing explicit instantiantions. Please let us know if it happens.
159
160
161    Using curlpp in .NET applications
162
163    If you are going to use curlpp library in a .NET project you have to use dynamic RTL.
164    This is because all .NET applications must use dynamic RTL and if your application uses curlpp,
165    the library itself has to use dynamic RTL as well.
166
167
168    Additional dependencies
169
170    To build examples (and your project as well) you need the following Windows lib files to link successfully
171    WSock32.lib, Wldap32.lib
172    These files comes with WindowsSDK. Macro $(WIN_SDK_DIR) (by default $(WindowsSdkDir)) is used in the properties
173	sheet file curlpp.examples.VC9.vsprops by VC9 solution to find these libraries.
174
175
176    Linking with OpenSSL
177
178    If you have libcurl compiled with OpenSSL support and want to have support for OpenSSL in curlpp as well
179    you have to set value of OPENSSL_PATH user macro to your installation of OpenSSL before building curlpp.
180    This variable is used in the project file for VC9 to find include and lib files of OpenSSL.
181    Steps to set user macro. Select View/Property Manager, double-click curlpp property sheet, go to
182    Common Properties/User Macros/, double-click name of macro you want to modify, modify it and click OK.
183    You have to link with OpenSSL which uses RTL in the same way as you are going to use RTL in curlpp lib.
184    Refering to build categories defined earlier in section "Choosing configuration" both OpenSSL and curlpp
185    must have the same build category.
186    Filenames of OpenSSL lib files should be in the form libeay32X.lib and ssleay32X.lib, where X denotes
187    build category chosen for curlpp. You have to add both this filenames to
188    Project properties\Librarian\Additional Dependencies (when building static library)
189    or
190    Project properties\Linker\Input\Additional Dependencies (when building dynamic library).
191
192    If you need OpenSSL for Windows platform take a look at http://www.slproweb.com/products/Win32OpenSSL.html
193    If you installed OpenSSL downloaded from the above link you'll find .lib files of all four build categories
194    in the /lib/vc directory.
195
196
197    Building with support for Boost
198
199    curlpp has ability to use some features from the Boost library. If you want to build curlpp with support for Boost
200    you have to set value of BOOST_PATH user macro to your installation of Boost before building curlpp.
201    This variable is used in the project file for VC9 to find include files of Boost.
202    You also have to define preprocessor symbol HAVE_BOOST. You can do it in
203    Project/Properties/C/C++/Preprocessor/Preprocessor Definitions.
204
205
206    Project propery sheets
207
208    All user macros like LIBCURL_PATH, OPENSSL_PATH, BOOST_PATH, CURLPP_INCLUDE_PATH, CURLPP_LIB_PATH, WIN_SDK_DIR,
209	CURLPP_EXAMPLES_OUT_DIR, etc.
210	are defined in project property sheet files named
211	curlpp.common.vsprops   - options and macros used during build of library itself and during build of examples
212	curlpp.lib.vsprops      - options and macros used during build of library itself
213	curlpp.examples.vsprops - options and macros used during build of examples
214
215
216	Compiler warnings
217
218	There are a few kinds of compiler warnings which we haven't managed to remove.
219
220	warning C4251: class X needs to have dll-interface to be used by clients of class Y
221	warning C4275: non dll-interface class X used as base for dll-interface class Y
222	warning C4512: X : assignment operator could not be generated
223	warning C4661: methodX : no suitable definition provided for explicit template instantiation request
224
225
226BUILDING CURLPP EXAMPLES
227
228Your can either build the examples from MS Visual Studio IDE or from the command line from within examples folder:
229
230    nmake -f Makefile.msvc all
231      or
232    nmake -f Makefile.msvc exampleXY
233      to build example XY
234
235
236Giuseppe "Cowo" Corbelli, cowo at lugbs dot linux dot it
237Andrei Korostelev, andrei at korostelev dot net
238Piotr Dobrogost, pd.curlpp.org (November 2008 - March 2009)