Qt 编译 Qt OPC UA

Building Qt OPC UA with open62541

Qt OPC UA is not included in the Qt installer and must be built from source.
The open62541 backend is currently the most stable and feature complete open source backend in Qt OPC UA. The open62541 library has minimal external dependencies and can be built for all supported platforms (Linux, Windows (MinGW32, MSVC 2017), Android, macOS and iOS).

NEW: Starting with the 5.12 branch, Open62541 v0.3.0 has been added to Qt OPC UA  as a 3rd party source. The open62541 plugin is now built by default without requiring any additional setup.

Requirements

First of all, an installation of Qt 5.12 is required. Using the Qt installer also provides the necessary tools required to build Qt OPC UA except Perl which must be installed manually.

Compiling on Linux

git clone https://code.qt.io/qt/qtopcua.git
cd qtopcua
git checkout 5.12
mkdir build && cd build
~/Qt/5.12.0/gcc_64/bin/qmake ..
make
sudo make install # sudo is not required if Qt 5.12 has been installed to a directory owned by the user

Compiling  on macOS

git clone https://code.qt.io/qt/qtopcua.git
cd qtopcua
git checkout 5.12
mkdir build && cd build
~/Qt/5.12.0/clang_64/bin/qmake ..
make
sudo make install # sudo is not required if Qt 5.12 has been installed to a directory owned by the user

Compiling on Windows

MinGW32

Execute the following commands in the  “Qt 5.12.0 for Desktop (MinGW 5.3.0 32 bit)” shell

git clone https://code.qt.io/qt/qtopcua.git
cd qtopcua
git checkout 5.12
mkdir build
cd build
qmake ..
mingw32-make
mingw32-make install

MSVC 2017

Execute the following commands in the “Qt 5.12.0 64-bit for Desktop (MSVC 2017)” shell

"c:\Program Files (x86)\Microsoft Visual Studio\2017\WDExpress\VC\Auxiliary\Build\vcvarsx86_amd64.bat"
git clone https://code.qt.io/qt/qtopcua.git
cd qtopcua
git checkout 5.12
mkdir build
cd build
qmake ..
nmake
nmake install

Compiling for Android

Additional requirements

The Android NDK is required to build for Android.

Compiling on Linux

git clone https://code.qt.io/qt/qtopcua.git
cd qtopcua
git checkout 5.12
mkdir build && cd build
export ANDROID_NDK_ROOT=/path/to/android-ndk-r17b
~/Qt/5.12.0/android_armv7/bin/qmake ..
# When building for android_x86 (e. g. simulator), use "~/Qt/5.12.0/android_x86/bin/qmake" instead
make
sudo make install# sudo is not required if Qt 5.12 has been installed to a directory owned by the user

Compiling on Windows

Execute the following commands in the  “Qt 5.12.0 for Desktop (MinGW 5.3.0 32 bit)” shell

git clone https://code.qt.io/qt/qtopcua.git
cd qtopcua
git checkout 5.12
mkdir build
cd build
set ANDROID_NDK_ROOT=c:\path\to\android-ndk-r17b
set ANDROID_NDK_HOST=windows-x86_64 # Only set this if the windows-x86_64 Android NDK is used
c:\Qt\5.12.0\android_armv7\bin\qmake ..
# When building for android_x86 (e. g. simulator), use "c:\Qt\5.12.0\android_x86\bin\qmake" instead
mingw32-make
mingw32-make install

Compiling for iOS

Additional requirements

XCode is required to build for iOS.

Compiling on macOS

git clone https://code.qt.io/qt/qtopcua.git
cd qtopcua
git checkout 5.12
mkdir build
cd build
~/Qt/5.12.0/ios/bin/qmake ..
make
sudo make install # sudo is not required if Qt 5.12 has been installed to a directory owned by the user

Creating the documentation

Use the same shell and the platform specific make tool that has been used in building the Qt OPC UA module. Building the docs on Linux or macOS requires using sudo to execute the second step if Qt has been installed to a location not writable by the current user.

make docs
make install_docs

Compiling the examples

Use the same shell and the platform specific make tool that has been used in building the Qt OPC UA module. The examples will be created in “examples” in the build directory.

export LD_LIBRARY_PATH=/path/to/Qt/5.12.0/gcc_64/lib/:$LD_LIBRARY_PATH # Linux only
make sub-examples

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值