For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

can not compile qt tutorial

Liu Zhipeng's picture

the OCCT version is 7.4.0

the compiling system is msys2 mingw64, I installed the compiler tool chain by

pacman -Syu mingw-w64-x86_64-qtcreator

cd opencascade-7.4.0

mkdir build

cd build

cmake .. -D_INSTALL_DIR=D:/msys64/mingw64/OCCT

mingw32-make

mingw32-make install

then I tried to compile the project in folder \opencascade-7.4.0\samples\qt\Tutorial, but got a lot of mistakes

I tried to edit the Tutorial.pro file to correct all mistakes, I resolved many mistakes but failed at a point, this is the Tutorial.pro file, please read

TEMPLATE = app

CONFIG += debug_and_release qt

 
TARGET = Tutorial

 

SAMPLESROOT = $$quote(F:/Source/OpenCASCADE/opencascade-7.4.0/samples/qt)


 

HEADERS = src/ApplicationTut.h \

            src/DocumentTut.h \
            $$quote(F:/Source/OpenCASCADE/opencascade-7.4.0/samples/qt/Common/src/DocumentCommon.h) \
            $$quote(F:/Source/OpenCASCADE/opencascade-7.4.0/samples/qt/Common/src/MDIWindow.h) \

 

 

SOURCES += src/ApplicationTut.cxx \

            src/DocumentTut.cxx \
            src/Main.cxx \
            src/MakeBottle.cxx

 
TS_FILES  = $${SAMPLESROOT}/Common/src/Common-icon.ts \
            $${SAMPLESROOT}/Common/src/Common-string.ts \
            ./src/Tutorial-icon.ts \
            ./src/Tutorial-string.ts

RES_FILES = $$quote(F:/Source/OpenCASCADE/opencascade-7.4.0/samples/qt/Tutorial/res/SampleImportExport.png) \

            $$quote(F:/Source/OpenCASCADE/opencascade-7.4.0/samples/qt/Tutorial/res/Bottle.png) \

 
RES_DIR = $$quote(F:/Source/OpenCASCADE/opencascade-7.4.0/samples/qt/Tutorial/res)

 

INCLUDEPATH += $$quote(F:/Source/OpenCASCADE/opencascade-7.4.0/samples/qt/Common/src)

INCLUDEPATH += $$quote(F:/Source/OpenCASCADE/opencascade-7.4.0/samples/qt/Interface/src)
INCLUDEPATH += $$quote(D:/msys64/mingw64/OCCT/inc)

 

 
OCCT_DEFINES = $$(CSF_DEFINES)

 
DEFINES = $$split(OCCT_DEFINES, ;)

 
unix {
    UNAME = $$system(uname -s)
    LIBLIST = $$(LD_LIBRARY_PATH)
    LIBPATHS = $$split(LIBLIST,":")
    for(lib, LIBPATHS):LIBS += -L$${lib}

 
    CONFIG(debug, debug|release) {
        DESTDIR = ./$$UNAME/bind
        OBJECTS_DIR = ./$$UNAME/objd
        MOC_DIR = ./$$UNAME/mocd
    } else {
        DESTDIR = ./$$UNAME/bin
        OBJECTS_DIR = ./$$UNAME/obj
        MOC_DIR = ./$$UNAME/moc
    }

 
    MACOSX_USE_GLX = $$(MACOSX_USE_GLX)

 
    !macx | equals(MACOSX_USE_GLX, true): INCLUDEPATH += $$QMAKE_INCDIR_X11 $$QMAKE_INCDIR_OPENGL $$QMAKE_INCDIR_THREAD
    equals(MACOSX_USE_GLX, true): DEFINES += MACOSX_USE_GLX
    DEFINES += OCC_CONVERT_SIGNALS QT_NO_STL
    !macx | equals(MACOSX_USE_GLX, true): LIBS += -L$$QMAKE_LIBDIR_X11 $$QMAKE_LIBS_X11 -L$$QMAKE_LIBDIR_OPENGL $$QMAKE_LIBS_OPENGL $$QMAKE_LIBS_THREAD
    LIBS += -lfreeimageplus
    LIBS += -ltbb -ltbbmalloc
    QMAKE_CXXFLAGS += -std=gnu++11
}

 
win32 {
    CONFIG(debug, debug|release) {
        DEFINES += _DEBUG
        DESTDIR = ./win$$(ARCH)/$$(VCVER)/bind
        OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/objd
        MOC_DIR = ./win$$(ARCH)/$$(VCVER)/mocd
    } else {
        DEFINES += NDEBUG
        DESTDIR = ./win$$(ARCH)/$$(VCVER)/bin
        OBJECTS_DIR = ./win$$(ARCH)/$$(VCVER)/obj
        MOC_DIR = ./win$$(ARCH)/$$(VCVER)/moc
    }
    LIBS = -L$$(QTDIR)/lib;$$(CSF_OCCTLibPath)
    DEFINES += NO_COMMONSAMPLE_EXPORTS NO_IESAMPLE_EXPORTS
}

 
LIBS += -lTKernel -lTKMath -lTKService -lTKV3d -lTKOpenGl \
        -lTKBRep -lTKIGES -lTKSTL -lTKVRML -lTKSTEP -lTKSTEPAttr -lTKSTEP209 \
        -lTKSTEPBase -lTKGeomBase -lTKGeomAlgo -lTKG3d -lTKG2d \
        -lTKXSBase -lTKShHealing -lTKHLR -lTKTopAlgo -lTKMesh -lTKPrim \
        -lTKCDF -lTKBool -lTKBO -lTKFillet -lTKOffset -lTKLCAF \

 
!exists($${RES_DIR}) {
    win32 {
        system(mkdir $${RES_DIR})
    } else {
        system(mkdir -p $${RES_DIR})
    }
}

 
lrelease.name = LRELEASE ${QMAKE_FILE_IN}
lrelease.commands = lrelease ${QMAKE_FILE_IN} -qm $${RES_DIR}/${QMAKE_FILE_BASE}.qm
lrelease.output = ${QMAKE_FILE_BASE}.qm
lrelease.input = TS_FILES
lrelease.clean = $${RES_DIR}/${QMAKE_FILE_BASE}.qm
lrelease.CONFIG += no_link target_predeps
QMAKE_EXTRA_COMPILERS += lrelease

 
copy_res.name = Copy resource ${QMAKE_FILE_IN}
copy_res.output = ${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
copy_res.clean = $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
copy_res.input = RES_FILES
copy_res.CONFIG += no_link target_predeps
win32: copy_res.commands = type ${QMAKE_FILE_IN} > $${RES_DIR}/${QMAKE_FILE_BASE}${QMAKE_FILE_EXT}
unix:  copy_res.commands = cp -f ${QMAKE_FILE_IN} $${RES_DIR}
QMAKE_EXTRA_COMPILERS += copy_res
#QMAKE_CXXFLAGS += \wd4996

 
greaterThan(QT_MAJOR_VERSION, 4) {
    QT += widgets
} 


 

and the mistake during mingw32-make is

/usr/bin/bash: line 0: type: ../Tutorial/res/SampleImportExport.png: not found

/usr/bin/bash: line 0: type: ../Tutorial/res/Bottle.png: not found

mingw32-make[1]: *** [Makefile.Release:129: SampleImportExport.png] Error 1

mingw32-make[1]: *** Waiting for unfinished jobs....

mingw32-make[1]: *** [Makefile.Release:132: Bottle.png] Error 1

mingw32-make: *** [Makefile:38: release] Error 2

I am really confused why the file can't be found, please help me.