Build issue with openssl 0.7.14 on Windows 64 msvc


#1

Dear all,

some library in my code needs openssl 0.7.14. To compile it on Windows, I did all the steps necessary as described here by downloading the pre-build binaries of openssl (version 1.1 64Bit) and set OPENSSL_LIB_DIR and OPENSSL_LIB_INCLUDE to c:\OpenSSL-Win64 and c:\OpenSSL-Win64\include.

However, the compiler does not find the include file:

C:\Users\admin\lipotypexplorer2\webapp-rs>cargo build
   Compiling openssl-sys-extras v0.7.14
   Compiling openssl v0.7.14
error: failed to run custom build command for `openssl-sys-extras v0.7.14`
process didn't exit successfully: `C:\Users\admin\lipotypexplorer2\webapp-rs\target\debug\build\openssl-sys-extras-9b7fd248446bc955\build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("true")
running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX64\\x64\\cl.exe" "/nologo" "/MD" "/Z7" "/W4" "/FoC:\\Users\\admin\\lipotypexplorer2\\webapp-rs\\target\\debug\\build\\openssl-sys-extras-f48f3b23bf7f465f\\out\\src\\openssl_shim.o" "/c" "src/openssl_shim.c"
openssl_shim.c
src/openssl_shim.c(1): fatal error C1083: Cannot open include file: 'openssl/hmac.h': No such file or directory
exit code: 2

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX64\\x64\\cl.exe" "/nologo" "/MD" "/Z7" "/W4" "/FoC:\\Users\\admin\\lipotypexplorer2\\webapp-rs\\target\\debug\\build\\openssl-sys-extras-f48f3b23bf7f465f\\out\\src\\openssl_shim.o" "/c" "src/openssl_shim.c" with args "cl.exe" did not execute successfully (status code exit code: 2).

', C:\Users\admin\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.54\src\lib.rs:1670:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `openssl v0.7.14`
process didn't exit successfully: `C:\Users\admin\lipotypexplorer2\webapp-rs\target\debug\build\openssl-1f7bf69cc28db5fb\build-script-build` (exit code: 101)
--- stdout
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = None
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
DEBUG = Some("true")
running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX64\\x64\\cl.exe" "/nologo" "/MD" "/Z7" "/W4" "/FoC:\\Users\\admin\\lipotypexplorer2\\webapp-rs\\target\\debug\\build\\openssl-78ef6f89cb47dc73\\out\\src\\c_helpers.o" "/c" "src/c_helpers.c"
c_helpers.c
src/c_helpers.c(1): fatal error C1083: Cannot open include file: 'openssl/ssl.h': No such file or directory
exit code: 2

--- stderr
thread 'main' panicked at '

Internal error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.13.26128\\bin\\HostX64\\x64\\cl.exe" "/nologo" "/MD" "/Z7" "/W4" "/FoC:\\Users\\admin\\lipotypexplorer2\\webapp-rs\\target\\debug\\build\\openssl-78ef6f89cb47dc73\\out\\src\\c_helpers.o" "/c" "src/c_helpers.c" with args "cl.exe" did not execute successfully (status code exit code: 2).

', C:\Users\admin\.cargo\registry\src\github.com-1ecc6299db9ec823\gcc-0.3.54\src\lib.rs:1670:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.


C:\Users\admin\lipotypexplorer2\webapp-rs>echo %OPENSSL_INCLUDE_DIR%
c:\OpenSSL-Win64\include

I have no idea of what to do now. Any help is deeply appreciated!


#2

I ran into a similar issue. Did you manage to solve it?


#3

At the end, I used a newer version of openssl (don’t remember which) which had a ‘build.rs’ and was building the openssl lib itself. This worked for me.