Published by orzz.org(). (https://orzz.org/qt-5-11-1-compiled/)
1、下载
下载地址:http://download.qt.io/archive/qt/5.11/5.11.1/single/
注意:
该下载目录下有两个文件,分别是 qt-everywhere-src-5.11.1.zip 和 qt-everywhere-src-5.11.1.tar.xz。
其中,zip在win下使用,tar.xz在linux下使用。它们解压后的文件,换行符是不同的。
2、配置 & 编译
• win32-g++
1 |
configure -confirm-license -opensource -platform win32-g++ -nomake examples -nomake tests -skip qtdoc -opengl desktop -no-angle -prefix C:\\Develop\\Qt5.11.1 |
• linux-g++
1 |
./configure -confirm-license -opensource -platform linux-g++ -nomake examples -nomake tests -skip qtdoc -opengl desktop -no-angle -prefix /home/dev/Qt5.11.1 |
修改 qt-everywhere-src-5.11.1/qtserialbus/src/plugins/canbus/socketcan/socketcanbackend.h 和 cpp,将
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#include <linux/can/raw.h> ...... #ifndef CANFD_MTU // CAN FD support was added by Linux kernel 3.6 // For prior kernels we redefine the missing defines here // they are taken from linux/can/raw.h & linux/can.h enum { CAN_RAW_FD_FRAMES = 5 }; #define CAN_MAX_DLEN 8 #define CANFD_MAX_DLEN 64 struct canfd_frame { canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ __u8 len; /* frame payload length in byte */ __u8 flags; /* additional flags for CAN FD */ __u8 __res0; /* reserved / padding */ __u8 __res1; /* reserved / padding */ __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8))); }; #define CAN_MTU (sizeof(struct can_frame)) #define CANFD_MTU (sizeof(struct canfd_frame)) #endif |
从cpp移到头文件中。
Published by orzz.org(). (https://orzz.org/qt-5-11-1-compiled/)