opendnp3 building with openssl on windows

593 views
Skip to first unread message

bursl...@gmail.com

unread,
Jul 25, 2017, 2:21:30 PM7/25/17
to automatak-dnp3
Hello,

Having some issues building on windows. I can build openDNP3 on linux no problem.

I cant seem to get the OPENSSL to be found on windows? I have no idea.

Any help would be appreciated,
Gary C


C:\>cd build

C:\build>dir
Volume in drive C has no label.
Volume Serial Number is AC2C-3B07

Directory of C:\build

07/25/2017 12:41 PM <DIR> .
07/25/2017 12:41 PM <DIR> ..
07/25/2017 07:03 AM 18,038 ALL_BUILD.vcxproj
07/25/2017 06:27 AM 268 ALL_BUILD.vcxproj.filters
07/25/2017 07:08 AM <DIR> asiodnp3.dir
07/25/2017 07:03 AM 31,807 asiodnp3.vcxproj
07/25/2017 06:27 AM 9,150 asiodnp3.vcxproj.filters
07/25/2017 07:07 AM <DIR> asiopal.dir
07/25/2017 07:03 AM 29,714 asiopal.vcxproj
07/25/2017 06:27 AM 6,423 asiopal.vcxproj.filters
07/25/2017 08:02 AM 18,006 CMakeCache.txt
07/25/2017 11:37 AM <DIR> CMakeFiles
07/25/2017 06:27 AM 5,400 cmake_install.cmake
07/25/2017 07:07 AM <DIR> Debug
07/25/2017 07:03 AM 22,231 format.vcxproj
07/25/2017 06:27 AM 634 format.vcxproj.filters
07/25/2017 07:03 AM 11,481 INSTALL.vcxproj
07/25/2017 06:27 AM 499 INSTALL.vcxproj.filters
07/25/2017 07:07 AM <DIR> opendnp3.dir
07/25/2017 06:27 AM 9,391 opendnp3.sln
07/25/2017 07:03 AM 65,340 opendnp3.vcxproj
07/25/2017 06:27 AM 62,628 opendnp3.vcxproj.filters
07/25/2017 07:07 AM <DIR> openpal.dir
07/25/2017 07:03 AM 31,958 openpal.vcxproj
07/25/2017 06:27 AM 10,059 openpal.vcxproj.filters
07/25/2017 11:37 AM <DIR> Release
07/25/2017 07:07 AM <DIR> Win32
07/25/2017 07:03 AM 16,328 ZERO_CHECK.vcxproj
07/25/2017 06:27 AM 500 ZERO_CHECK.vcxproj.filters
19 File(s) 349,855 bytes
10 Dir(s) 94,985,187,328 bytes free

C:\build>cmake ..\dnp3-2.0.x -DFULL=ON
CMake build is: Release
enabling all optional components
ASIO has NOT been checked out as a git submodule...
ASIO_HOME defined in cache: C:\asio-1.10.8\include
CMake Error at C:/cmake-3.9.0-win32-x86/share/cmake-3.9/Modules/FindPackageHandl
eStandardArgs.cmake:137 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
C:/cmake-3.9.0-win32-x86/share/cmake-3.9/Modules/FindPackageHandleStandardArgs
.cmake:377 (_FPHSA_FAILURE_MESSAGE)
C:/cmake-3.9.0-win32-x86/share/cmake-3.9/Modules/FindOpenSSL.cmake:388 (find_p
ackage_handle_standard_args)
CMakeLists.txt:77 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/build/CMakeFiles/CMakeOutput.log".

C:\build>cmake ..\dnp3-2.0.x -DFULL=ON -DOPENSSL_CRYPTO_LIBRARY="C:\openssl\src\
openssl\0.9.8h\openssl-0.9.8h"
CMake build is: Release
enabling all optional components
ASIO has NOT been checked out as a git submodule...
ASIO_HOME defined in cache: C:\asio-1.10.8\include
CMake Error at C:/cmake-3.9.0-win32-x86/share/cmake-3.9/Modules/FindPackageHandl
eStandardArgs.cmake:137 (message):
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
C:/cmake-3.9.0-win32-x86/share/cmake-3.9/Modules/FindPackageHandleStandardArgs
.cmake:377 (_FPHSA_FAILURE_MESSAGE)
C:/cmake-3.9.0-win32-x86/share/cmake-3.9/Modules/FindOpenSSL.cmake:388 (find_p
ackage_handle_standard_args)
CMakeLists.txt:77 (find_package)


-- Configuring incomplete, errors occurred!
See also "C:/build/CMakeFiles/CMakeOutput.log".

C:\build>cmake ..\dnp3-2.0.x -DFULL=ON -DOPENSSL_CRYPTO_LIBRARY="C:\openssl\src\
openssl\0.9.8h\openssl-0.9.8h"

Adam Crain

unread,
Jul 25, 2017, 2:25:33 PM7/25/17
to automatak-dnp3
Hi,

Cmake can automatically find openssl on windows if you use the installers from Shining light as described here:


I think the v1.0.2L is what you want. 
(20MB Installer).

There may be other ways to tell CMake where the headers/libraries are but we haven't explored them.

-Adam

bursl...@gmail.com

unread,
Jul 25, 2017, 2:34:01 PM7/25/17
to automatak-dnp3
I did download shining light openssl. All to no avail. Most weried. I still see the missing CRYPTO_LIBRARY etc.

bursl...@gmail.com

unread,
Jul 25, 2017, 2:46:17 PM7/25/17
to automatak-dnp3
Just downloaded v1.0.2L openssl and installed it in the C drive. I perform a cmake its still not finding it automatically?

bursl...@gmail.com

unread,
Jul 25, 2017, 2:56:50 PM7/25/17
to automatak-dnp3
Hello,
Not sure if this is related. I can build the dnp3-2.x project and all the libs using Visual Studio.

Why would I get the below when attempting to build the dotNet code. Possibly missing openssl? I'm not sure
.
Thanks,
Gary C

Severity    Code    Description    Project    File    Line    Suppression State
Error    CS0006    Metadata file 'C:\dnp3-2.0.x\dotnet\bindings\CLRAdapter\Debug\Win32\DNP3CLRAdapter.dll' could not be found    CLRMasterDemo    C:\dnp3-2.0.x\dotnet\examples\master\CSC    1    Active

Sid Hoda

unread,
Jul 26, 2017, 3:18:56 AM7/26/17
to automatak-dnp3
Hi Gary,

Could you try running the build-dotnet.bat script in the repo root?

This will require cmake to be in PATH and also OSSL_LIB32_DIR and VS140COMNTOOLS environment variables set.

On my machine I have:
OSSL_LIB32_DIR = C:\OpenSSL-Win32\lib\VC
VS140COMNTOOLS = C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\

Also, do you have VC++ 2015 x86 redistributable installed?

Sid

bursl...@gmail.com

unread,
Jul 26, 2017, 10:01:53 AM7/26/17
to automatak-dnp3

Hey Guys,

I got it working this morning and can build the VC project in windows., Really appreciate the
help on this. A couple of things stopped me.
1) Ensure that you download the correct version of package on Shining Light...seems obvious.
2) Ensure when building the opendnp3 and example C# app that they are both the same, release/or debug but must match otherwise you get a slew of errors.
3) I used the latest sdk development kit otherwise other files are not found.

Again thanks again.

Cheers,
Gary C

J Adam Crain

unread,
Jul 26, 2017, 1:00:41 PM7/26/17
to automatak-dnp3
Hi Gary,

That's great.

I created a ticket for the documentation to make sure we don't lose this info:


Can you clarify which SDK you're referring to for the ticket?

bursl...@gmail.com

unread,
Jul 27, 2017, 1:41:11 PM7/27/17
to automatak-dnp3

I had multiple SDK packages installed. I used Windows SDK 10.0 with Visual Studio 2017.

Configuration Properties->General.

Cheers,
Gary C
Reply all
Reply to author
Forward
Message has been deleted
0 new messages