Can't compile own project

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
BuS_trs
Jr. Member
Jr. Member
Posts: 2
Joined: 20 Oct 2011, 08:45

Can't compile own project

Post by BuS_trs »

Hello,

I tried your C++ SDK client examples and they worked quite well.

But when I create a new empty project, load the "callback.h" and "client_cpp_sdk_tutorial.cpp" from lesson 2, add the include/library directories and the preprocessor defines... I get compiler errors:

First it says:

Code: Select all

c:programmeunifiedautomationuasdkcppbundleevalincludeuaclientuaclientsdk.h(31) : 
fatal error C1083: Datei (Include) kann nicht geöffnet werden: "uapkiconfig.h": 
No such file or directory
So I also add "uapki" to the include directories but then I get a ton of errors:

http://i.imgur.com/8tUpT.png


What am I doing wrong?

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

Re:Can't compile own project

Post by Support Team »

Hello BuS_trs!

You wrote that you added all include folders and all libraries, but have you also added the OS dependend libraries? The png you sent, indicates that there are some missing libraries.

All libraries you need are listed below (the 'd' indicates debug):
- Rpcrt4.lib, ws2_32.lib, crypt32.lib, libeay32(d).lib, uaclient(d).lib, uabase(d).lib, uastack(d).lib, uapki(d).lib

The associated library folders are:
- third-party/win32/vs2008sp1/openssl/out32dll (or for debug: third-party/win32/vs2008sp1/openssl/out32dll.dbg), lib

Also add all important preprocessor defines:
- _CRT_SECURE_NO_WARNINGS, _CRT_SECURE_NO_DEPRACATE, _UA_STACK_USE_DLL, OPCUA_SUPPORT_SECURITYPOLICY_BASIC128RSA15=1, OPCUA_SUPPORT_SECURITYPOLICY_BASIC256=1, OPCUA_SUPPORT_SECURITYPOLICY_NONE=1, OPCUA_SUPPORT_PKI=1

The important include folders are:
- sdk/third-party/win32/vs2008sp1/openssl/inc32, sdk/include/uastack, sdk/include/uabase, sdk/include/uaclient, sdk/include/uapki

This all should help you to get a working VS Solution.


Best regards

Support Team
Best regards
Unified Automation Support Team

BuS_trs
Jr. Member
Jr. Member
Posts: 2
Joined: 20 Oct 2011, 08:45

Re:Can't compile own project

Post by BuS_trs »

Thanks for the answer!

I found out that there are some errors regarding the documentation:

1. It is neccassary to add crypt32.lib and uapkid.lib to additional dependencies in Linker Settings -> Input.
They're missing in the documentation
2. The entry uaclientcpp.lib in linker settings is wrong! It cannot be found. But you have to add uaclientd.lib
3. You also have to copy uastackd.dll and libeay32d.dll from bin folder to your output folder

Now my own projects are compiling.

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

Re:Can't compile own project

Post by Support Team »

Thank you for your hint. We will fix this for the next release.

Best regards

Support Team
Best regards
Unified Automation Support Team

Post Reply