[QT]QT5.5+VS2013编译安装QtCharts和Data Visualization



原创文章,欢迎转载。转载请注明:转载自 祥的博客

原文链接:https://blog.csdn.net/humanking7/article/details/80583083


0.[2018.10.31]补充

重新做了系统后,发现nmake各种错误,缺少各种h文件,估计原因是环境没有配置好,但是各种环境都和原来一模一样,也运行了vs的工具命令环境。

网上提示说VS2013没有完全安装成功会出现这个错误,重装VS2013,完全成功后,问题解决。

最后查看了环境变量,发现环境变量多出了几个

C:\Qt\Qt5.5.0\5.5\msvc2013\bin;
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE;
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin;
# 多出来的环境变量,估计是Windows Performance Toolkit环境变量的缺失,导致缺少nmake所需的头文件
C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;
C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;

原文如下

1.问题引出

一直在做一个用QT开发的项目,一直用的是QT5.5.0开发,最近要用qtchartsqt data visualization进行开发。由于 Qt5.8.0 不支持WebEngine,而再高的版本,对于MSVC2013的支持又不好(QT5.9开始只MSVC2013-x64,而QT5.11放弃了对MSVC2013的支持,针对本机环境进行下载测试,在Win7-x86平台有待考证)

开发环境:

  • Windows7 - x64
  • MSVC 2013 - x86
  • QT 5.5.0 - x86

2.预备环节

先安装 Perl 环境!

先安装 Perl 环境!

先安装 Perl 环境!

这篇文章写的不错:如何下载安装脚本编译器ActivePerl

安装完成后记得要测试:(如果不行,就检查一下环境变量,必要时需要重启)

pic1

3.下载源码并版本回退

# 血的教训:
# 我的Qt版本是5.5.0,不能支持QtCharts_5.11,所以第一次我是直接github上的qt/qtcharts上找到对应的5.7.0的Release,直接下载的zip,解压后编译,各种莫名的错误。

# 正确的做法:先git clone最新版本,再git checkout到需要的版本,然后在编译。

3.1.先下载源码

> git clone https://github.com/qt/qtcharts.git

3.2.版本回退到5.7

> git checkout 5.7 #版本回退到5.7

4.编译安装以及编译文档

> "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\vcvars32.bat" # 配置nmake的环境
> qmake CONFIG+="debug_and_release build_all" # 生成Makefile
Info: creating cache file C:\Users\Arthur\Downloads\Compressed\plugin\qtcharts\.qmake.cache
> nmake # 编译源码
...
...[漫长的等待]...
...
> nmake install
...
...[漫长的等待]...
...
> nmake docs # 编译帮助文档

5.更新帮助文档和example

5.1.更新帮助文档

将编译目录中 docs 目录下的 qtchartsqtcharts.qch 复制到 Qt安装目录下的 Docs\Qt-5.5

D:\Qt\Qt5.5.0_x86\Docs\Qt-5.5 # 我的安装目录

pic2

5.2.更新example

将编译目录中 example 目录下的 qtcharts复制到 Qt安装目录下的 Examples\Qt-5.5

D:\Qt\Qt5.5.0_x86\Examples\Qt-5.5 # 我的安装目录

6. 安装 Qt Data visualization

和上述步骤一样,只是获取的网址不一样。

> git clone https://github.com/qt/qtdatavis3d # 获取源码

7. 福利项

本文涉及的源码:https://download.csdn.net/download/humanking7/10511970

从github上down下来,版本已经checkout到需要的版本。可直接按照教程来, Enjoy ~!


赞赏码

  • 3
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
--------------------------- Qt Data Visualization 5.7.0 --------------------------- Qt Data Visualization module provides multiple graph types to visualize data in 3D space both with C++ and Qt Quick 2. System Requirements =================== - Qt 5.2.1 or newer - OpenGL 2.1 or newer (recommended) or OpenGL ES2 (reduced feature set) - Manipulating Qt Data Visualization graphs with QML Designer requires Qt Creator 3.3 or newer Building ======== Configure the project with qmake: qmake After running qmake, build the project with make: (Linux) make (Windows with MinGw) mingw32-make (Windows with Visual Studio) nmake (OS X) make The above generates the default makefiles for your configuration, which is typically the release build if you are using precompiled binary Qt distribution. To build both debug and release, or one specifically, use one of the following qmake lines instead. For debug builds: qmake CONFIG+=debug make or qmake CONFIG+=debug_and_release make debug For release builds: qmake CONFIG+=release make or qmake CONFIG+=debug_and_release make release For both builds (Windows/OS X only): qmake CONFIG+="debug_and_release build_all" make After building, install the module to your Qt directory: make install If you want to uninstall the module: make uninstall Building as a statically linked library ======================================= The same as above applies, you will just have to add static to the CONFIG: qmake CONFIG+=static Documentation ============= The documentation can be generated with: make docs The documentation is generated into the doc folder under the build folder. Both Qt Assistant (qtdatavisualization.qch) and in HTML format (qtdatavisualization subfolder) documentation is generated. Please refer to the generated documentation for more information: doc/qtdatavisualization/qtdatavisualization-index.html Known Issues ============ - Some platforms like Android and WinRT cannot handle multiple native windows properly, so only the Qt Quick 2 versions of graphs are available in practice for those platforms. - Shadows are not supported with OpenGL ES2 (including Angle builds in Windows). - Anti-aliasing doesn't work with OpenGL ES2 (including Angle builds in Windows). - QCustom3DVolume items are not supported with OpenGL ES2 (including Angle builds in Windows). - Surfaces with non-straight rows and columns do not always render properly. - Q3DLight class (and Light3D QML item) are currently not usable for anything. - Changing most of Q3DScene properties affecting subviewports currently has no effect. - Widget based examples layout incorrectly in iOS. - Reparenting a graph to an item in another QQuickWindow is not supported. - Android builds of QML applications importing QtDataVisualization also require "QT += datavisualization" in the pro file. This is because Qt Data Visualization QML plugin has a dependency to Qt Data Visualization C++ library, which Qt Creator doesn't automatically add to the deployment package. - Only OpenGL ES2 emulation is available for software renderer (that is, when using QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL))
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值