Use Qt in Debian for OpenCASCADE
Use Qt in Debian for OpenCASCADE
Recently several OpenCASCADE enthusiasts want to build my simple Qt demo about OpenCASCADE on ubuntu system, but could not compile it successfully. Because I only compiled the occQt in Windows system, do not try it in Linux system. I try to build it on Debian system, also have the same errors as follows:
Figure 1. Compile errors of Building occQt on Debian
In order to use Qt5 in Debian7, you can input the following commands:
1. Get Qt5 on Debian:
sudo apt-get install qt5-default qt5-qmake qtbase5-dev-tools qtchooser2. Download the newest version of QtCreator from Qt website:
http://www.qt.io/download-open-source/#section-6
You can get the following file:
qt-creator-opensource-linux-x86_64-3.4.0.run
Figure 2. Download Qt Creator for Linux
3. Install QtCreator manually:
Install Qt Creator manually by the following commands:
chmod u+x ./qt-creator-opensource-linux-x86_64-3.4.0.run./qt-creator-opensource-linux-x86_64-3.4.0.run
Figure 3. Qt Creator Setup
Figure 4. Qt Creator Setup
4. It is succeed When the Qt Creator Icon appears in the Applications.
Figure 5. Qt Creator in Applications
5. I tried the math_Vector, it runs correctly, the code list as follows:
#include math_Vector.hxxvoid TestVector(void)
{
math_Vector aVector(1, 3);
aVector.Init(1.0);
aVector.Dump(std::cout);
aVector = -aVector;
aVector.Dump(std::cout);
aVector = aVector.Opposite();
aVector.Dump(std::cout);
}
int main()
{
TestVector();
return 0;
}
The configuration of the test project as follows:
TEMPLATE = appCONFIG += console
CONFIG -= app_bundle
CONFIG -= qt
SOURCES += main.cpp
include(deployment.pri)
qtcAddDeployment()
INCLUDEPATH += /home/eryar/opencascade-6.8.0/inc
DEPENDPATH += /home/eryar/opencascade-6.8.0
LIBS += -L/home/eryar/opencascade-6.8.0/lib/ -lTKernel -lTKMath
The result shows:
Figure 6. Test math_Vector in Qt on Debian
It can compile and run correctly, the compile error in occQt do not appear in the test program. you can also debug the code in Qt Creator. So use Qt Creator to program on Linux is very convenient.
PDF Version: Use Qt in Debian for OpenCASCADE
相关文章
- Qt之QTableView显示富文本
- 【Qt开发】 QT:make: Nothing to be done for `first'和error:QtSql:No such file or directory
- 【Qt开发】 QT:make: Nothing to be done for `first'和error:QtSql:No such file or directory
- 【Linux开发】为qt-embedded添加jpeg库的交叉编译方法for arm
- qt invalid use of incomplete type class QDebug
- qt QTreeWidget使用
- qt连接mysql数据库实例
- 解决 Qt5 报错 This application failed to start because it could not find or load the Qt platform plugin
- PyQt(Python+Qt)学习随笔:PyQt界面派生类构造方法中super方法的使用
- 让Qt for Windows Phone 8.1在真机上执行
- QT中获取选中的radioButton的两种方法
- QT 5.1.1 for Android 开发环境搭建与配置【Windows 7】
- 【Qt】Qt 开发环境安装 ( Qt 版本 5.14.2 | Qt 下载 | Qt 安装 )
- QT发布含qml文件的程序,打包后无法加载qml窗口
- Undo/Redo for Qt Tree Model
- qt for Android之新建项目模板(带toast,数据库)
- qt for android实现app内通过按键后台运行程序
- qt for Android解决全面屏手机安装程序出现下部黑边显示不全问题
- qt for Android屏幕横向/全屏显示