bazza2jw / open62541Cpp

C++ Wrappers for Open62541 Version 0.3
35 stars 22 forks source link

compatible versions of open62541 an open62541Cpp #20

Open augustinust opened 2 years ago

augustinust commented 2 years ago

I tried to compile open62541Cpp, but I get compile errors. I assume this is due to incompatible versions of open62541 and open62541Cpp.

Is there any information available which versions of the two libraries match?

GoetzGoerisch commented 2 years ago

I don't know which project is the original source, but we are using this https://github.com/seronet-project/open62541Cpp Which is maintained and used here: https://github.com/umati/Sample-Server

piperoc commented 2 years ago

@GoetzGoerisch @augustinust I looked at the seronet-project wrappers and it seems very different that this (which has many more features and it appears to be maintained more often). I think this one is excellent and I will be testing it. From the Cmake files (especially open62541Cpp/Common.cmake) it looks like they are not looking for a specific open62541 version but they require the open62541 library to be built and installed on the system, which I don't particularly like in my case.

# the open62541 C library must have been installed
find_library(OPEN62541 open62541 ${CMAKE_INSTALL_PREFIX}/lib)
#

Since this open62541cpp is in development I'd rather have the open62541 build together so I can activate some flags for profiling, etc. I'm going to create my own CMake for that and possibly share for comments

piperoc commented 2 years ago

Well I tried for a while but could not manage to link from code. I ended up installing the open62541 library....:(

In case you want to do the same, here's the commands I used to build the open62541 library (using the released tag v1.3.3 but you can change that) and install:

git clone --depth 1 --branch v1.3.3 https://github.com/open62541/open62541.git

cd open62541

git submodule update --init --recursive

mkdir build && cd build

cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local -DMDNSD_LOGLEVEL=300 -DUA_ARCHITECTURE=posix -DUA_BUILD_EXAMPLES=ON -DUA_BUILD_TOOLS=ON -DUA_BUILD_UNIT_TESTS=OFF -DUA_ENABLE_AMALGAMATION=OFF -DUA_ENABLE_DA=ON -DUA_ENABLE_DISCOVERY=ON -DUA_ENABLE_DISCOVERY_MULTICAST=ON -DUA_ENABLE_ENCRYPTION=ON -DUA_ENABLE_ENCRYPTION_MBEDTLS=OFF -DUA_ENABLE_ENCRYPTION_OPENSSL=ON -DUA_ENABLE_HISTORIZING=ON -DUA_ENABLE_METHODCALLS=ON -DUA_ENABLE_MICRO_EMB_DEV_PROFIL=OFF -DUA_ENABLE_NODEMANAGEMENT=ON -DUA_ENABLE_PARSING=ON -DUA_ENABLE_SUBSCRIPTIONS=ON -DUA_ENABLE_SUBSCRIPTIONS_ALARMS=ON -DUA_ENABLE_SUBSCRIPTIONS_EVENTS=ON -DUA_ENABLE_WEBSOCKET_SERVER=OFF -DUA_LOGLEVEL=300 -DUA_MULTITHREADING=110 -DUA_NAMESPACE_ZERO=FULL ..

make

sudo make install

good luck.

If anyone reading this can find a way to link open62541 without installing let me know.