README.md (5616B)
1 <!-- 2 Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. 3 4 SPDX-License-Identifier: curl 5 --> 6 7 Building via IDE Project Files 8 ============================== 9 10 This document describes how to compile, build and install curl and libcurl 11 from sources using legacy versions of Visual Studio 2010 - 2013. 12 13 You need to generate the project files before using them. Please run "generate 14 -help" for usage details. 15 16 To generate project files for recent versions of Visual Studio instead, use 17 cmake. Refer to INSTALL-CMAKE.md in the docs directory. 18 19 Another way to build curl using Visual Studio is without project files. Refer 20 to README in the winbuild directory. 21 22 ## Directory Structure 23 24 The following directory structure is used for the legacy project files: 25 26 somedirectory\ 27 |_curl 28 |_projects 29 |_<platform> 30 |_<ide> 31 |_lib 32 |_src 33 34 This structure allows for side-by-side compilation of curl on the same machine 35 using different versions of a given compiler (for example VC10 and VC12) and 36 allows for your own application or product to be compiled against those 37 variants of libcurl for example. 38 39 Note: Typically this side-by-side compilation is generally only required when 40 a library is being compiled against dynamic runtime libraries. 41 42 ## Dependencies 43 44 The projects files also support build configurations that require third party 45 dependencies such as OpenSSL and libssh2. If you wish to support these, you 46 also need to download and compile those libraries as well. 47 48 To support compilation of these libraries using different versions of 49 compilers, the following directory structure has been used for both the output 50 of curl and libcurl as well as these dependencies. 51 52 somedirectory\ 53 |_curl 54 | |_ build 55 | |_<architecture> 56 | |_<ide> 57 | |_<configuration> 58 | |_lib 59 | |_src 60 | 61 |_openssl 62 | |_ build 63 | |_<architecture> 64 | |_VC <version> 65 | |_<configuration> 66 | 67 |_libssh2 68 |_ build 69 |_<architecture> 70 |_VC <version> 71 |_<configuration> 72 73 As OpenSSL does not support side-by-side compilation when using different 74 versions of Visual Studio, a helper batch file has been provided to assist 75 with this. Please run `build-openssl -help` for usage details. 76 77 ## Building with Visual C++ 78 79 To build with VC++, you have to first install VC++ which is part of Visual 80 Studio. 81 82 Once you have VC++ installed you should launch the application and open one of 83 the solution or workspace files. The VC directory names are based on the 84 version of Visual C++ that you use. Each version of Visual Studio has a 85 default version of Visual C++. We offer these versions: 86 87 - VC10 (Visual Studio 2010 Version 10.0) 88 - VC11 (Visual Studio 2012 Version 11.0) 89 - VC12 (Visual Studio 2013 Version 12.0) 90 91 Separate solutions are provided for both libcurl and the curl command line 92 tool as well as a solution that includes both projects. libcurl.sln, curl.sln 93 and curl-all.sln, respectively. We recommend using curl-all.sln to build both 94 projects. 95 96 For example, if you are using Visual Studio 2010 then you should be able to 97 use `VC10\curl-all.sln` to build curl and libcurl. 98 99 ## Running DLL based configurations 100 101 If you are a developer and plan to run the curl tool from Visual Studio with 102 any third-party libraries (such as OpenSSL or libssh2) then you need to add 103 the search path of these DLLs to the configuration's PATH environment. To do 104 that: 105 106 1. Open the 'curl-all.sln' or 'curl.sln' solutions 107 2. Right-click on the 'curl' project and select Properties 108 3. Navigate to 'Configuration Properties > Debugging > Environment' 109 4. Add `PATH='Path to DLL';C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem` 110 111 ... where 'Path to DLL` is the configuration specific path. For example the 112 following configurations in Visual Studio 2010 might be: 113 114 DLL Debug - DLL OpenSSL (Win32): 115 116 PATH=..\..\..\..\..\openssl\build\Win32\VC10\DLL Debug;C:\Windows\System32; 117 C:\Windows;C:\Windows\System32\Wbem 118 119 DLL Debug - DLL OpenSSL (x64): 120 121 PATH=..\..\..\..\..\openssl\build\Win64\VC10\DLL Debug;C:\Windows\System32; 122 C:\Windows;C:\Windows\System32\Wbem 123 124 If you are using a configuration that uses multiple third-party library DLLs 125 (such as DLL Debug - DLL OpenSSL - DLL libssh2) then 'Path to DLL' need to 126 contain the path to both of these. 127 128 ## Notes 129 130 The following keywords have been used in the directory hierarchy: 131 132 - `<platform>` - The platform (For example: Windows) 133 - `<ide>` - The IDE (For example: VC10) 134 - `<architecture>` - The platform architecture (For example: Win32, Win64) 135 - `<configuration>` - The target configuration (For example: DLL Debug, LIB 136 Release - LIB OpenSSL) 137 138 Should you wish to help out with some of the items on the TODO list, or find 139 bugs in the project files that need correcting, and would like to submit 140 updated files back then please note that, whilst the solution files can be 141 edited directly, the templates for the project files (which are stored in the 142 git repository) need to be modified rather than the generated project files 143 that Visual Studio uses. 144 145 ## Legacy Windows and SSL 146 147 Some of the project configurations use Schannel (Windows SSPI), the native SSL 148 library that comes with the Windows OS. Schannel in Windows 8 and earlier is 149 not able to connect to servers that no longer support the legacy handshakes 150 and algorithms used by those versions. If you are using curl in one of those 151 earlier versions of Windows you should choose another SSL backend like 152 OpenSSL.