Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
C++: Linker and 64bit issues
February 24, 2025
11:30, EET
Avatar
Guido Niewerth
Member
Members
Forum Posts: 15
Member Since:
August 23, 2022
sp_UserOfflineSmall Offline

Hello,

I’m trying to use the TuaServer in a 64bit C++ application and I run into linker issues. I created a new VCL Forms application, dragged the TUaServer Component onto the form and compiled. Compilation succeeded, but the linker issued a lot of mostly unreolved externals. After I added these lines

#pragma link “ssleay32.lib”
#pragma link “libeay32.lib”
#pragma link “uastack_32.lib”
#pragma link “prosysopc.uaserver290.lib”

the linker was able to link correctly.

Then I switched from 32bit to 64bit and changed the linker instructions to

#pragma link “ssleay32.a”
#pragma link “libeay32.a”
#pragma link “uastack_32.a”
#pragma link “prosysopc.uaserver290.a”

and the linker was unable to find any of those files. I checked the lib290x64 folder and these file were indeed missing. I created the .a files from the corresponding DLLs using Embarcaderos mkexp tool, but I have no clue what file to link for the 64bit versions of TUaServer. So I tried

#pragma comment (lib, “ssleay32” )
#pragma comment (lib, “libeay32” )
#pragma comment (lib, “ustack_32” )
#pragma comment (lib, “prosysopc.uaserver290” )

to make the linker choose which files to link, but it didn’t fix the issues, I still get the linker error “Unable to open file prosysopc.uaserver.o”.
What can I do to resolve this?

I am using the classic 64bit C++ compiler, which should be fine as you state in the install.txt file.

Windows 11 64bit Professional
RAD Studio 12.1 (Delphi 12 and C++ Builder 12 Update 1, RAD Studio 12.1 Patch 1)
Prosys OPC SDK 7.8.0 for Athens 12

Kind regards,
Guidoi

February 24, 2025
11:48, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1029
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Hi Guido,

From the install.txt:

64-BIT C++ COMPILATION

RAD Studio 12.1 Athens introduced a new Clang based 64-bit C++ compiler
that fixes severe compiler issues that prevented using the OPC UA
components in 64-bit C++ applications. You can enable the new compiler
with the Windows 64-bit (Modern) profile in your C++ application.

The new Clang compatible libraries are delivered in the libNNNx64x
folder (where NNN refers to the VCL version, e.g. 290).

Unfortunately, due to problems in the older compilers, the classic 64-bit
C++ OPC UA libraries (enabled with the Windows 64-bit target platform)
fail to link properly and therefore the C++ binaries are not included in
the installation (in libNNNx64). There will be no fix to this from Embarcadero.


So you need to use the libraries in lib290x64x instead of lib290x64 – and use the ‘Modern’ compiler.

The header files, ProsysOPC.UaClient.Libs.h and ProsysOPC.UaServer.Libs.h should use the proper pragmas, so just include them in your source.

February 24, 2025
12:29, EET
Avatar
Guido Niewerth
Member
Members
Forum Posts: 15
Member Since:
August 23, 2022
sp_UserOfflineSmall Offline

Ah, my bad, thanks for pointing that out.
I probably messed the whole paragraph up and drew the wrong conclusion.

February 26, 2025
14:36, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1029
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

Yeah, it’s not that clear. I wasn’t quite sure how to do this, but thought that it’s better to keep the classic lib64 and modern lib64x separate, although we only have the latter for C++. It makes it a bit more complicated, but seems that Embarcadero is following the same principle.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
31 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 90

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 788

Moderators: 8

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1542

Posts: 6505

Newest Members:

Olpsom, shastaappleton, hildred39i, Adam, tammara49z, vktwaylon2, pilarstorkey83, Dwightsache, MollyAlori, somnath.kalane

Moderators: Jouni Aro: 1029, Pyry: 1, Petri: 0, Bjarne Boström: 1040, Jimmy Ni: 26, Matti Siponen: 353, Lusetti: 0, Elias: 0

Administrators: admin: 1