Use Qt in Debian for OpenCASCADE

简介: Use Qt in Debian for OpenCASCADE eryar@163.com Recently several OpenCASCADE enthusiasts want to build my simple Qt demo about OpenCASCADE on ubuntu system, but could not compile it successfully.

Use Qt in Debian for OpenCASCADE

eryar@163.com

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:

wps_clip_image-9806

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 qtchooser

2. 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

wps_clip_image-22633

Figure 2. Download Qt Creator for Linux

3. Install QtCreator manually:

Install Qt Creator manually by the following commands:

chmod  u + ./ qt - creator - opensource - linux - x86_64 - 3.4 . 0 . run

./ qt - creator - opensource - linux - x86_64 - 3.4 . 0 . run

wps_clip_image-16257

Figure 3. Qt Creator Setup

wps_clip_image-3440

Figure 4. Qt Creator Setup

4. It is succeed When the Qt Creator Icon appears in the Applications.

wps_clip_image-26540

Figure 5. Qt Creator in Applications

5. I tried the math_Vector, it runs correctly, the code list as follows:

#include  < math_Vector.hxx >

void  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  =  app

CONFIG 
+=  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:

wps_clip_image-25550

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.

目录
相关文章
|
8月前
|
数据可视化 C++
msvc编译opencascade和vtk
1.opencascade源码 我下载的时候最新版本是7.7.0
109 0
|
24天前
|
Ubuntu 编译器 Linux
Ubuntu下Qt编程,从QT的安装到编写notepad
Ubuntu下Qt编程,从QT的安装到编写notepad
|
XML SQL 编译器
|
Linux
Linux-SmartHome-QML-2-Qt环境安装
CentOS7安装Qt就简单好多了,哈哈,下载Qt ,直接拖到虚机器里面。给运行权限,完了和Win一样,傻瓜安装就可以。安装完成后,可以在左上角的编程里面找到Qt的运行图标,点击是可以运行的,但是建立一个简单的程序,是运行不了的,应该是缺少库,但是少那个了,应该是OpenGL相关,
84 0
Linux-SmartHome-QML-2-Qt环境安装
|
开发工具 C++ IDE