2D cam software - start

David

Active CAD practitioner
@JSlyadne: Did what you recommended. When generating with CMake I get now the following error:


CMake Error at adm/cmake/qt_macro.cmake:48 (qt4_wrap_cpp):
Unknown CMake command "qt4_wrap_cpp".
Call Stack (most recent call first):
adm/cmake/occt_toolkit.cmake:222 (FIND_AND_WRAP_MOC_FILES)
CMakeLists.txt:14 (include)
samples/qt/FuncDemo/CMakeLists.txt:4 (OCCT_INCLUDE_CMAKE_FILE)

The good message is, we are now with qt problems. So please inform, what version and where you have installed the QT ?
 

DanB

CAD community veteran
@JSlyadne: Did what you recommended. When generating with CMake I get now the following error:


CMake Error at adm/cmake/qt_macro.cmake:48 (qt4_wrap_cpp):
Unknown CMake command "qt4_wrap_cpp".
Call Stack (most recent call first):
adm/cmake/occt_toolkit.cmake:222 (FIND_AND_WRAP_MOC_FILES)
CMakeLists.txt:14 (include)
samples/qt/FuncDemo/CMakeLists.txt:4 (OCCT_INCLUDE_CMAKE_FILE)

The good message is, we are now with qt problems. So please inform, what version and where you have installed the QT ?
My setup:
Selected 5.15 for all compilers, but I mainly use MSVC 2019 64-bit.
Then I went to Visual Studio and downloaded the Qt extension from the extension manager. There are a couple of steps that you have to do in Visual Studio:
Then you have to do all the project settings in the project properties.

I did never bother to build the Qt samples that come with OCCT. I used this example to get started:
 

JSlyadne

Administrator
Staff member
The good message is, we are now with qt problems. So please inform, what version and where you have installed the QT ?
Use the Qt maintenance tool to download various Qt stuff (binaries, sources, samples, etc.) The link to this tool is given by DanB above.

As I can see out of CMake configuration files, OpenCascade supports Qt of versions 4 and 5 for its samples, so you can try out any of them, but, as it was earlier mentioned, version 4 is very old.

After you download the installer and roll out the Qt to your PC, check ON "BUILD_SAMPLES_QT" mark and set "3RDPARTY_QT_DIR" to the directory where Qt installed - see the screenshot below (don't pay attention on that Qt 6.x is there, it's my current working version and I don't have another one on my PC right now) and click "Configure".

1646583124650.png

Check CMake GUI that Qt5_DIR is not set to QT5_DIR-NOTFOUND. If Qt5_DIR is missed there or point to the meaning directory, it means that Qt is found successfully. Congrats! After that, you can generate and open solution. No other tricks are normally required.

1646583361496.png
 

David

Active CAD practitioner
@JSlyadne:
Thank you for all your efforts but I still cannot find a working set-up of OCCT 7.6.0. and QT5.12.5.

In CMake GUI there is no QT5_DIR-NOTFOUND. Still I get the same nasty error:

CMake Error at adm/cmake/occt_toolkit.cmake:35 (include_directories):
include_directories given empty-string as include directory.
Call Stack (most recent call first):
CMakeLists.txt:14 (include)
samples/qt/FuncDemo/CMakeLists.txt:4 (OCCT_INCLUDE_CMAKE_FILE)

CMake Error at adm/cmake/qt_macro.cmake:48 (qt4_wrap_cpp):
Unknown CMake command "qt4_wrap_cpp".
Call Stack (most recent call first):
adm/cmake/occt_toolkit.cmake:222 (FIND_AND_WRAP_MOC_FILES)
CMakeLists.txt:14 (include)
samples/qt/FuncDemo/CMakeLists.txt:4 (OCCT_INCLUDE_CMAKE_FILE)

I have set-up the same on a Windows 10 machine to see if there is any additional difficulty coming from Window 11. Same result.
I doubt that anyone has used this make file OCCT 7.6.0 with QT5.12.5 successfully without any tweak.
I DO NOT CARE TO USE OLDER VERSION OF OCCT. In the coming days I will try it with 7.5.0 and QT4.8. version quaoar used in his tutorial.
I have wasted your time and 4 full days of set-up trials. Maybe in future there will be someone skilled who can find a set-up for non-advanced users of Cmake and QT like me.....
 

JSlyadne

Administrator
Staff member
@David, I've checked OCCT v760 with Qt 5.12 - works properly, no tweaks required. Something should be wrong with your setup. Let's check one more guess. Go to "Edit the system environment variables" and check the "PATH" variable there and other Qt related variables. Are there any Qt footprints? If yes, clean up it, and try "Configure" again.
 
Last edited:

David

Active CAD practitioner
No environmental variables like PATH show any QT related entries.
Could you post your GUI CMake screen shot ? I cannot believe, that someone simply installed QT5.12.5. and configured it via the make file without tweaking the make file. I have done the set-up several times with several different settings on one PC (Windows 11) and the last one on a completely different second PC (Windows 10) with the same problems.
 

David

Active CAD practitioner
... but I am actually trying to learn make file scripts. So hopefully I find the nessary tweak. If so, I will naturally post it.
 

DanB

CAD community veteran
... but I am actually trying to learn make file scripts. So hopefully I find the nessary tweak. If so, I will naturally post it.
As mentioned multiple times before, you do not need to build the Qt samples to be able to use OCCT together with Qt. If you feel that is absolutely necessary for you, make sure that you give the path to the CMake folder that comes with Qt. While I'm being on a business trip I do not have access to the setup on my workstation, so I can't check the exact path for you right now. But you should be fine without.
 

natalia

Moderator
Staff member
Hi @David
OCCT Qt samples are compiled good on my PC with Visual Studio 2022 and Qt 5.15.2. Below, I’ll add the steps of it.

Before it, let’s check an idea. It’s good that you attached what you use to compile.
went to:
downloaded there the file: opencascade-7.6.0.tgz
unpacked it to e.g. c:\Users\Public\opencascade-7.6.0

went to:
clicked on Windows32
under Products vc14 downloaded the following 64bit products:
FFmpeg 3.3.4
Freeimage 3.17.0
Freetype 2.5.5
unpacked them to e.g. c:\Users\Public\3rd_party

went to https://visualstudio.microsoft.com/de/downloads/
download the Community Version 17.1 and installed it

downloaded the file qt-opensource-windows-x86-5.12.5.exe
installed it not under c:\qt\Qt5.12.5. but under c:\Qt .
Just selected the following component: MSVC2017 64 bit

installed CMake 3.23.0-rc2.
when starting it: Browse Source the source code: C:\Users\Public\opencascade-7.6.0
and in "Where to build the binaries": C:\Users\Public\opencascade-7.6.0-build
Clicked Configure. Then selected: generator for the project: Visual Studio 17 2022, use default native compilers and clicked "Finish".

Then I got the error:
Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.22000.
The C compiler identification is MSVC 19.31.31104.0
The CXX compiler identification is MSVC 19.31.31104.0
Detecting C compiler ABI info
Detecting C compiler ABI info - failed
Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe
Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.23/Modules/CMakeTestCCompiler.cmake:69 (message):
The C compiler
"C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.31.31103/bin/Hostx64/x64/cl.exe"
is not able to compile a simple test program.

It fails with the following output:
Change Dir: C:/Users/Public/opencascade-7.6.0-build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe cmTC_f6251.vcxproj /p:Configuration=Debug /p:platform=x64 /p:VisualStudioVersion=17.0 /v:m && Microsoft (R)-Build-Engine, Version 17.1.0+ae57d105c fr .NET Framework
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten
Microsoft (R) C/C++-Optimierungscompiler Version 19.31.31104 fr x64
testCCompiler.c
C:\Users\Public\opencascade-7.6.0-build\CMakeFiles\CMakeTmp\testCCompiler.c : fatal error C1090: Fehler beim PDB-API-Aufruf, Fehlercode "3": C:\Users\Public\opencascade-7.6.0-build\CMakeFiles\CMakeTmp\cmTC_f6251.dir\Debug\vc143.pdb [C:\Users\Public\opencascade-7.6.0-build\CMakeFiles\CMakeTmp\cmTC_f6251.vcxproj]
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_f6251.dir\Debug\\" /Fd"cmTC_f6251.dir\Debug\vc143.pdb" /external:W3 /Gd /TC /errorReport:queue "C:\Users\Public\opencascade-7.6.0-build\CMakeFiles\CMakeTmp\testCCompiler.c"
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:39 (project)
Configuring incomplete, errors occurred!
See also "C:/Users/Public/opencascade-7.6.0-build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Public/opencascade-7.6.0-build/CMakeFiles/CMakeError.log".



In the CMakeError.log I find the following:

Detecting C compiler ABI info failed to compile with the following output:
Change Dir: C:/Users/Public/opencascade-7.6.0-build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe cmTC_63662.vcxproj /p:Configuration=Debug /p:platform=x64 /p:VisualStudioVersion=17.0 /v:m && Microsoft (R)-Build-Engine, Version 17.1.0+ae57d105c fr .NET Framework
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
Microsoft (R) C/C++-Optimierungscompiler Version 19.31.31104 fr x64
CMakeCCompilerABI.c
C:\Program Files\CMake\share\cmake-3.23\Modules\CMakeCCompilerABI.c : fatal error C1090: Fehler beim PDB-API-Aufruf, Fehlercode "3": C:\Users\Public\opencascade-7.6.0-build\CMakeFiles\CMakeTmp\cmTC_63662.dir\Debug\vc143.pdb [C:\Users\Public\opencascade-7.6.0-build\CMakeFiles\CMakeTmp\cmTC_63662.vcxproj]
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_63662.dir\Debug\\" /Fd"cmTC_63662.dir\Debug\vc143.pdb" /external:W3 /Gd /TC /errorReport:queue "C:\Program Files\CMake\share\cmake-3.23\Modules\CMakeCCompilerABI.c"
Determining if the C compiler works failed with the following output:
Change Dir: C:/Users/Public/opencascade-7.6.0-build/CMakeFiles/CMakeTmp
Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe cmTC_f6251.vcxproj /p:Configuration=Debug /p:platform=x64 /p:VisualStudioVersion=17.0 /v:m && Microsoft (R)-Build-Engine, Version 17.1.0+ae57d105c fr .NET Framework
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
Microsoft (R) C/C++-Optimierungscompiler Version 19.31.31104 fr x64
testCCompiler.c
C:\Users\Public\opencascade-7.6.0-build\CMakeFiles\CMakeTmp\testCCompiler.c : fatal error C1090: Fehler beim PDB-API-Aufruf, Fehlercode "3": C:\Users\Public\opencascade-7.6.0-build\CMakeFiles\CMakeTmp\cmTC_f6251.dir\Debug\vc143.pdb [C:\Users\Public\opencascade-7.6.0-build\CMakeFiles\CMakeTmp\cmTC_f6251.vcxproj]
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.
cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_f6251.dir\Debug\\" /Fd"cmTC_f6251.dir\Debug\vc143.pdb" /external:W3 /Gd /TC /errorReport:queue "C:\Users\Public\opencascade-7.6.0-build\CMakeFiles\CMakeTmp\testCCompiler.c"


Any help appreciated.
So, in my check the sources and 3rd-parties are downloaded as in your post. The same for CMake and Visual Studio.
I see only one difference: Qt. But it is not the version, it’s your note:
“Just selected the following component: MSVC2017 64 bit”. I have another installation, it's full Qt with default options proposed.
So, may be, it is worth comparing what we have in your and mine Qt installation directory? On my installed version, there is:
qt_installed.png
CMake files to find Qt by OCCT procedure are from this directory:

qt_installed_cmake.png

Please, check if your Qt has these directories.
Your problem looks like by some reason, this Qt is not found by OCCT CMake procedure at all.


So, to compile Qt samples for 7.6.0 version of OCCT on your 3rd-parties and sources, the performed compilation steps are:
Launch CMake and give directory to sources and build, call Configure, the result is:
vstudio_2022_configure.png
Set 3RDPATY_DIR to C:/Users/Public/3rd_party

Call ‘Configure’ again and have:

vstudio_2022_configure_3rd_parties.png
There are warnings (caused by newest CMake, but it's done!)
So, moving to the next step:
Set ‘BUILD_SAMPLES_QT’ checked, call Configure again and have:
vstudio_2022_configure_qt_required.png

Set ‘3RDPARTY_QT_DIR’ to ‘C:\Qt_5.15.2\5.15.2\msvc2019_64’, call Configure once again and have:
vstudio_2022_configure_qt_found.png
Call ‘Generate’

Start ‘Visual Studio 2022’ and check if ‘Samples’ appears in the Solution tree:
vstudio_2022_solution_tree.png
Compile all.
Set active one of compiled sample, e.g. OCCTOverview.
Correct PATH environment for this project to be able to start it from Visual Studio like:
OCCTOverview_Environment.png

Call F5 and have the application launched:
OCCTOverview_exe.png
 

jianbaoxia

CAD community veteran
@natalia It's nice for your meticulous explanation. I follow your steps, and success.
When I build the OCCTOverview, I meet a error: can't find Qt5Widgetsd.dll.
But I set the env for dll path to solve it.
So happy:)
1647274360831.png
 
Top