1*6236dae4SAndroid Build Coastguard Worker<!-- 2*6236dae4SAndroid Build Coastguard WorkerCopyright (C) Daniel Stenberg, <[email protected]>, et al. 3*6236dae4SAndroid Build Coastguard Worker 4*6236dae4SAndroid Build Coastguard WorkerSPDX-License-Identifier: curl 5*6236dae4SAndroid Build Coastguard Worker--> 6*6236dae4SAndroid Build Coastguard Worker 7*6236dae4SAndroid Build Coastguard WorkerBuilding via IDE Project Files 8*6236dae4SAndroid Build Coastguard Worker============================== 9*6236dae4SAndroid Build Coastguard Worker 10*6236dae4SAndroid Build Coastguard WorkerThis document describes how to compile, build and install curl and libcurl 11*6236dae4SAndroid Build Coastguard Workerfrom sources using legacy versions of Visual Studio 2010 - 2013. 12*6236dae4SAndroid Build Coastguard Worker 13*6236dae4SAndroid Build Coastguard WorkerYou will need to generate the project files before using them. Please run 14*6236dae4SAndroid Build Coastguard Worker"generate -help" for usage details. 15*6236dae4SAndroid Build Coastguard Worker 16*6236dae4SAndroid Build Coastguard WorkerTo generate project files for recent versions of Visual Studio instead, use 17*6236dae4SAndroid Build Coastguard Workercmake. Refer to INSTALL-CMAKE in the docs directory. 18*6236dae4SAndroid Build Coastguard Worker 19*6236dae4SAndroid Build Coastguard Worker## Directory Structure 20*6236dae4SAndroid Build Coastguard Worker 21*6236dae4SAndroid Build Coastguard WorkerThe following directory structure is used for the legacy project files: 22*6236dae4SAndroid Build Coastguard Worker 23*6236dae4SAndroid Build Coastguard Worker somedirectory\ 24*6236dae4SAndroid Build Coastguard Worker |_curl 25*6236dae4SAndroid Build Coastguard Worker |_projects 26*6236dae4SAndroid Build Coastguard Worker |_<platform> 27*6236dae4SAndroid Build Coastguard Worker |_<ide> 28*6236dae4SAndroid Build Coastguard Worker |_lib 29*6236dae4SAndroid Build Coastguard Worker |_src 30*6236dae4SAndroid Build Coastguard Worker 31*6236dae4SAndroid Build Coastguard WorkerThis structure allows for side-by-side compilation of curl on the same machine 32*6236dae4SAndroid Build Coastguard Workerusing different versions of a given compiler (for example VC10 and VC12) and 33*6236dae4SAndroid Build Coastguard Workerallows for your own application or product to be compiled against those 34*6236dae4SAndroid Build Coastguard Workervariants of libcurl for example. 35*6236dae4SAndroid Build Coastguard Worker 36*6236dae4SAndroid Build Coastguard WorkerNote: Typically this side-by-side compilation is generally only required when 37*6236dae4SAndroid Build Coastguard Workera library is being compiled against dynamic runtime libraries. 38*6236dae4SAndroid Build Coastguard Worker 39*6236dae4SAndroid Build Coastguard Worker## Dependencies 40*6236dae4SAndroid Build Coastguard Worker 41*6236dae4SAndroid Build Coastguard WorkerThe projects files also support build configurations that require third party 42*6236dae4SAndroid Build Coastguard Workerdependencies such as OpenSSL, wolfSSL and libssh2. If you wish to support 43*6236dae4SAndroid Build Coastguard Workerthese, you will also need to download and compile those libraries as well. 44*6236dae4SAndroid Build Coastguard Worker 45*6236dae4SAndroid Build Coastguard WorkerTo support compilation of these libraries using different versions of 46*6236dae4SAndroid Build Coastguard Workercompilers, the following directory structure has been used for both the output 47*6236dae4SAndroid Build Coastguard Workerof curl and libcurl as well as these dependencies. 48*6236dae4SAndroid Build Coastguard Worker 49*6236dae4SAndroid Build Coastguard Worker somedirectory\ 50*6236dae4SAndroid Build Coastguard Worker |_curl 51*6236dae4SAndroid Build Coastguard Worker | |_ build 52*6236dae4SAndroid Build Coastguard Worker | |_<architecture> 53*6236dae4SAndroid Build Coastguard Worker | |_<ide> 54*6236dae4SAndroid Build Coastguard Worker | |_<configuration> 55*6236dae4SAndroid Build Coastguard Worker | |_lib 56*6236dae4SAndroid Build Coastguard Worker | |_src 57*6236dae4SAndroid Build Coastguard Worker | 58*6236dae4SAndroid Build Coastguard Worker |_openssl 59*6236dae4SAndroid Build Coastguard Worker | |_ build 60*6236dae4SAndroid Build Coastguard Worker | |_<architecture> 61*6236dae4SAndroid Build Coastguard Worker | |_VC <version> 62*6236dae4SAndroid Build Coastguard Worker | |_<configuration> 63*6236dae4SAndroid Build Coastguard Worker | 64*6236dae4SAndroid Build Coastguard Worker |_libssh2 65*6236dae4SAndroid Build Coastguard Worker |_ build 66*6236dae4SAndroid Build Coastguard Worker |_<architecture> 67*6236dae4SAndroid Build Coastguard Worker |_VC <version> 68*6236dae4SAndroid Build Coastguard Worker |_<configuration> 69*6236dae4SAndroid Build Coastguard Worker 70*6236dae4SAndroid Build Coastguard WorkerAs OpenSSL and wolfSSL don't support side-by-side compilation when using 71*6236dae4SAndroid Build Coastguard Workerdifferent versions of Visual Studio, build helper batch files have been 72*6236dae4SAndroid Build Coastguard Workerprovided to assist with this. Please run `build-openssl -help` and/or 73*6236dae4SAndroid Build Coastguard Worker`build-wolfssl -help` for usage details. 74*6236dae4SAndroid Build Coastguard Worker 75*6236dae4SAndroid Build Coastguard Worker## Building with Visual C++ 76*6236dae4SAndroid Build Coastguard Worker 77*6236dae4SAndroid Build Coastguard WorkerTo build with VC++, you will of course have to first install VC++ which is 78*6236dae4SAndroid Build Coastguard Workerpart of Visual Studio. 79*6236dae4SAndroid Build Coastguard Worker 80*6236dae4SAndroid Build Coastguard WorkerOnce you have VC++ installed you should launch the application and open one of 81*6236dae4SAndroid Build Coastguard Workerthe solution or workspace files. The VC directory names are based on the 82*6236dae4SAndroid Build Coastguard Workerversion of Visual C++ that you will be using. Each version of Visual Studio 83*6236dae4SAndroid Build Coastguard Workerhas a default version of Visual C++. We offer these versions: 84*6236dae4SAndroid Build Coastguard Worker 85*6236dae4SAndroid Build Coastguard Worker - VC10 (Visual Studio 2010 Version 10.0) 86*6236dae4SAndroid Build Coastguard Worker - VC11 (Visual Studio 2012 Version 11.0) 87*6236dae4SAndroid Build Coastguard Worker - VC12 (Visual Studio 2013 Version 12.0) 88*6236dae4SAndroid Build Coastguard Worker 89*6236dae4SAndroid Build Coastguard WorkerSeparate solutions are provided for both libcurl and the curl command line 90*6236dae4SAndroid Build Coastguard Workertool as well as a solution that includes both projects. libcurl.sln, curl.sln 91*6236dae4SAndroid Build Coastguard Workerand curl-all.sln, respectively. We recommend using curl-all.sln to build both 92*6236dae4SAndroid Build Coastguard Workerprojects. 93*6236dae4SAndroid Build Coastguard Worker 94*6236dae4SAndroid Build Coastguard WorkerFor example, if you are using Visual Studio 2010 then you should be able to 95*6236dae4SAndroid Build Coastguard Workeruse `VC10\curl-all.sln` to build curl and libcurl. 96*6236dae4SAndroid Build Coastguard Worker 97*6236dae4SAndroid Build Coastguard Worker## Running DLL based configurations 98*6236dae4SAndroid Build Coastguard Worker 99*6236dae4SAndroid Build Coastguard WorkerIf you are a developer and plan to run the curl tool from Visual Studio with 100*6236dae4SAndroid Build Coastguard Workerany third-party libraries (such as OpenSSL, wolfSSL or libssh2) then you will 101*6236dae4SAndroid Build Coastguard Workerneed to add the search path of these DLLs to the configuration's PATH 102*6236dae4SAndroid Build Coastguard Workerenvironment. To do that: 103*6236dae4SAndroid Build Coastguard Worker 104*6236dae4SAndroid Build Coastguard Worker 1. Open the 'curl-all.sln' or 'curl.sln' solutions 105*6236dae4SAndroid Build Coastguard Worker 2. Right-click on the 'curl' project and select Properties 106*6236dae4SAndroid Build Coastguard Worker 3. Navigate to 'Configuration Properties > Debugging > Environment' 107*6236dae4SAndroid Build Coastguard Worker 4. Add `PATH='Path to DLL';C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem` 108*6236dae4SAndroid Build Coastguard Worker 109*6236dae4SAndroid Build Coastguard Worker... where 'Path to DLL` is the configuration specific path. For example the 110*6236dae4SAndroid Build Coastguard Workerfollowing configurations in Visual Studio 2010 might be: 111*6236dae4SAndroid Build Coastguard Worker 112*6236dae4SAndroid Build Coastguard WorkerDLL Debug - DLL OpenSSL (Win32): 113*6236dae4SAndroid Build Coastguard Worker 114*6236dae4SAndroid Build Coastguard Worker PATH=..\..\..\..\..\openssl\build\Win32\VC10\DLL Debug;C:\Windows\System32; 115*6236dae4SAndroid Build Coastguard Worker C:\Windows;C:\Windows\System32\Wbem 116*6236dae4SAndroid Build Coastguard Worker 117*6236dae4SAndroid Build Coastguard WorkerDLL Debug - DLL OpenSSL (x64): 118*6236dae4SAndroid Build Coastguard Worker 119*6236dae4SAndroid Build Coastguard Worker PATH=..\..\..\..\..\openssl\build\Win64\VC10\DLL Debug;C:\Windows\System32; 120*6236dae4SAndroid Build Coastguard Worker C:\Windows;C:\Windows\System32\Wbem 121*6236dae4SAndroid Build Coastguard Worker 122*6236dae4SAndroid Build Coastguard WorkerDLL Debug - DLL wolfSSL (Win32): 123*6236dae4SAndroid Build Coastguard Worker 124*6236dae4SAndroid Build Coastguard Worker PATH=..\..\..\..\..\wolfssl\build\Win32\VC10\DLL Debug;C:\Windows\System32; 125*6236dae4SAndroid Build Coastguard Worker C:\Windows;C:\Windows\System32\Wbem 126*6236dae4SAndroid Build Coastguard Worker 127*6236dae4SAndroid Build Coastguard WorkerDLL Debug - DLL wolfSSL (x64): 128*6236dae4SAndroid Build Coastguard Worker 129*6236dae4SAndroid Build Coastguard Worker PATH=..\..\..\..\..\wolfssl\build\Win64\VC10\DLL Debug;C:\Windows\System32; 130*6236dae4SAndroid Build Coastguard Worker C:\Windows;C:\Windows\System32\Wbem 131*6236dae4SAndroid Build Coastguard Worker 132*6236dae4SAndroid Build Coastguard WorkerIf you are using a configuration that uses multiple third-party library DLLs 133*6236dae4SAndroid Build Coastguard Worker(such as DLL Debug - DLL OpenSSL - DLL libssh2) then 'Path to DLL' will need 134*6236dae4SAndroid Build Coastguard Workerto contain the path to both of these. 135*6236dae4SAndroid Build Coastguard Worker 136*6236dae4SAndroid Build Coastguard Worker## Notes 137*6236dae4SAndroid Build Coastguard Worker 138*6236dae4SAndroid Build Coastguard WorkerThe following keywords have been used in the directory hierarchy: 139*6236dae4SAndroid Build Coastguard Worker 140*6236dae4SAndroid Build Coastguard Worker - `<platform>` - The platform (For example: Windows) 141*6236dae4SAndroid Build Coastguard Worker - `<ide>` - The IDE (For example: VC10) 142*6236dae4SAndroid Build Coastguard Worker - `<architecture>` - The platform architecture (For example: Win32, Win64) 143*6236dae4SAndroid Build Coastguard Worker - `<configuration>` - The target configuration (For example: DLL Debug, LIB 144*6236dae4SAndroid Build Coastguard Worker Release - LIB OpenSSL) 145*6236dae4SAndroid Build Coastguard Worker 146*6236dae4SAndroid Build Coastguard WorkerShould you wish to help out with some of the items on the TODO list, or find 147*6236dae4SAndroid Build Coastguard Workerbugs in the project files that need correcting, and would like to submit 148*6236dae4SAndroid Build Coastguard Workerupdated files back then please note that, whilst the solution files can be 149*6236dae4SAndroid Build Coastguard Workeredited directly, the templates for the project files (which are stored in the 150*6236dae4SAndroid Build Coastguard Workergit repository) will need to be modified rather than the generated project 151*6236dae4SAndroid Build Coastguard Workerfiles that Visual Studio uses. 152*6236dae4SAndroid Build Coastguard Worker 153*6236dae4SAndroid Build Coastguard Worker## Legacy Windows and SSL 154*6236dae4SAndroid Build Coastguard Worker 155*6236dae4SAndroid Build Coastguard WorkerSome of the project configurations allow the use of Schannel, the native SSL 156*6236dae4SAndroid Build Coastguard Workerlibrary in Windows which forms part of Windows SSPI. However, Schannel in 157*6236dae4SAndroid Build Coastguard WorkerWindows <= XP is unable to connect to servers that no longer support the 158*6236dae4SAndroid Build Coastguard Workerlegacy handshakes and algorithms used by those versions. If you will be using 159*6236dae4SAndroid Build Coastguard Workercurl in one of those earlier versions of Windows you should choose another SSL 160*6236dae4SAndroid Build Coastguard Workerbackend such as OpenSSL. 161