Page 1 of 1

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

Posted: 01 Dec 2022, 14:33
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?

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

Posted: 01 Dec 2022, 16:15
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.

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

Posted: 02 Dec 2022, 07:18
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?

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

Posted: 02 Dec 2022, 15:48
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.

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

Posted: 05 Dec 2022, 10:19
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)

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

Posted: 12 Dec 2022, 14:53
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.

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

Posted: 11 Jul 2023, 14:50
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.

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

Posted: 11 Jul 2023, 15:17
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.

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

Posted: 12 Jul 2023, 08:54
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.