2025-03-13 11:03:03 +08:00

38 lines
1.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

官网 https://www.open62541.org/
编译成动态库进行使用--BUILD_SHARED_LIBS
windows编译
1.需要安装python3
2.configure配置cmake选择 Visual Studio 14 2015 工具链的默认编译器编译
3.BUILD_SHARED_LIBS 打开此选项.然后generate
4.open project
5.解决方案重新生成获取open62541.dll
6.所有引入的头文件都在需要按照从open62541文件夹层级拷贝
linux编译如果没有ccmake则手动更改cmakelist
1.发行版的Linux都带有python3
2.在源码目录创建build
3.ccmake ..
4. BUILD_SHARED_LIBS 打开这个选项
5.cmake ..
6.make
7.获取open62541.so
8.所有引入的头文件都在需要按照从open62541文件夹层级拷贝
由于不同平台生成出来的config.h,宏定义使用逻辑有所不同,需要修改一下
/**
* Architecture
* ------------
* Define one of the following. */
下修改为以下代码
#if defined _WIN32 || defined __CYGWIN__
#define UA_ARCHITECTURE_WIN32
#else
#define UA_ARCHITECTURE_POSIX
#endif