各种踩坑,终于解决
1、由于本机使用的QT5.12.5,kylin 本机自带的QT4需要先屏蔽
2、查看qmake版本
qmake --version
3、修改qt的配置文件,将qt4改为qt5
cd /usr/lib/x86_64-linux-gnu/qt-default/qtchooser
sudo gedit default.conf
4、安装thrift各种依赖,编译安装工具,不再一一介绍大概就是
不过发现需要安装编译工具 lex, yacc,boost libevent openssl等等,其中libevent采用了源码编译安装。
sudo apt-get install yacc lex
不可以,后来发现, ubuntu上使用flex和bison来代替lex和yacc
sudo apt-get install flex bison
5、没有切换qt版本的问题
libtool: compile: g++ -std=c++11 -DHAVE_CONFIG_H -I. -I../.. -I../../lib/cpp/src/thrift -I../../lib/c_glib/src/thrift -I/usr/include -I./src -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/x86_64-linux-gnu/qt5 -fPIC -Wall -Wextra -pedantic -g -O2 -MT src/thrift/qt/libthriftqt5_la-moc__TQTcpServer.lo -MD -MP -MF src/thrift/qt/.deps/libthriftqt5_la-moc__TQTcpServer.Tpo -c src/thrift/qt/moc__TQTcpServer.cpp -fPIC -DPIC -o src/thrift/qt/.libs/libthriftqt5_la-moc__TQTcpServer.o
src/thrift/qt/moc__TQTcpServer.cpp:13:2: error: #error "This file was generated using the moc from 4.8.7. It"
#error "This file was generated using the moc from 4.8.7. It"
6.configure那一步,需要禁java 默认qt5
./configure --with–java = no --with-qt4=no
否则