Can't build examples, unresolved external symbol "EVP_PKEY_id"

Questions regarding the use of the High Perfomance SDK for Server development

Moderator: uasdkhpc

Post Reply
tim.starke
Jr. Member
Jr. Member
Posts: 4
Joined: 01 Dec 2022, 14:17

Can't build examples, unresolved external symbol "EVP_PKEY_id"

Post by tim.starke »

Hi,
I want to test the evaluation version and followed the instructions till the point, where I should build the project.
I get this Error Message in Visual Studio:
Errorcode: LNK2019
Description: unresolved external symbol EVP_PKEY_id referenced in function pki_cert_get_public_key
Project: uaserver_collection
file: D:\..\uasdkhpbundle_pubsub-1.6.1-eval-beta\bldExamples\examples\server_collection\hpsdk_uapkid.lib(cert.c.obj)

I tried both methods for Windows (Visual Studio project and CMake GUI; Visual Studio and Ninja) and I still get this error.

Do I need any files for it to work or how can I fix this?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Can't build examples, unresolved external symbol "EVP_PKEY_id"

Post by Support Team »

Hi,

hard to say what goes wrong here. The HighPerf-SDK requires OpenSSL being installed on your computer, the setup/installation requirements remind you for installing before compiling examples. Alternatively you could switch off security completely (but that makes not much sense when doing OPC UA)

Please check for OpenSSL and use correct version of OpenSSL. The delivered CMake files will find OpenSSL when present on your host.
Best regards
Unified Automation Support Team

tim.starke
Jr. Member
Jr. Member
Posts: 4
Joined: 01 Dec 2022, 14:17

Re: Can't build examples, unresolved external symbol "EVP_PKEY_id"

Post by tim.starke »

OpenSSL is installed. When I started I had the message from CMake reminding me to install it. I cmaked the whole project without any errors.
But where can I find the version number of OpenSSL that is needed for my SDK to work?

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Can't build examples, unresolved external symbol "EVP_PKEY_id"

Post by Support Team »

Hi,

the HighPerf SDK supports a range of OpenSSL. The EVP_PKEY exist from v1.0.1 and bigger. So if you use current long term v1.1.1 or even the new v3.0, you will be good and HighPerf SDK can be operated with either one.
Best regards
Unified Automation Support Team

tim.starke
Jr. Member
Jr. Member
Posts: 4
Joined: 01 Dec 2022, 14:17

Re: Can't build examples, unresolved external symbol "EVP_PKEY_id"

Post by tim.starke »

I found my mistake for this problem. I cmaked the project for x64. Corrected it and cmaked it for x86 (even though my system is x64).
But I still get a error messages from the linker. When I try to build an example I get about 50 Linker Error Messages about unresolved external symbols.
Example:
Building Examples/client_read
56 Errors in main.obj, readclient.obj, future.obj, client_utilities.obj.
I deleted them and cmaked them new, but that didn't changed anything
Screenshot form VS Studio
https://imgur.com/a/Hl9S2lc (can recommend zooming in for better readability)

tim.starke
Jr. Member
Jr. Member
Posts: 4
Joined: 01 Dec 2022, 14:17

Re: Can't build examples, unresolved external symbol "EVP_PKEY_id"

Post by tim.starke »

Ok, I found a solution to my problem. The instructions said, that I should cmake it for win32 and also to use OpenSSL32Bit. I tried it with the x64 version, as my system is also x64. Now it's working.
So there is a slight mistake in the instructions, telling you to choose "Win32" as architecture.

Utkrist
Hero Member
Hero Member
Posts: 22
Joined: 15 May 2023, 09:50

Re: Can't build examples, unresolved external symbol "EVP_PKEY_id"

Post by Utkrist »

Hi, I am facing a similar problem, and I have tried what you mentioned. In fact, I have tried all possible combination of cmake x64, cmake x86 and Openssl32 bit and 64 bit. Could you outline the steps in more detail. Right now, I am facing about 61 LNK2019 unresolved external symbol errors.
LNK2019 unresolved external symbol EVP_PKEY_size referenced in function crypto_key_length is one example of my errors.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Can't build examples, unresolved external symbol "EVP_PKEY_id"

Post by Support Team »

Hi,

yes that is correct the build instructions are written for 32 bit system, if your have 64 bit system instead, you must take an educated guess.

Second very common error is that you must make your self clear whether you build on the host system (which migth be a PC Intel x86/64), or if you are on the target system for which you finally build the UA Server for (which might be an embedded ARM with some 32 bit Linux derivate). Now remember, the OpenSSL is required by the UA SDK, is required by the UA Server, is running on the target system. You should build the OpenSSL for the correct system using correct toolchain. If mixing things up, you will get linker errors.

The third common error is that you use one OpenSSL version on the host and build against, but on the target having different OpenSSL version. Make your self clear which version you have on the target and use it to build your UA Server accordingly.
Best regards
Unified Automation Support Team

Utkrist
Hero Member
Hero Member
Posts: 22
Joined: 15 May 2023, 09:50

Re: Can't build examples, unresolved external symbol "EVP_PKEY_id"

Post by Utkrist »

Hi,

Thanks for your reply. Apparently, I had installed the same version of OpenSSL multiple times, so today I removed them completely and built from scratch again and it worked.

Post Reply