
Fri, 05/23/2025 - 03:06
Hi,
I am trying to build/install occt along with qt samples. here is my configuration:
- Windows 11
- Visual Studio 2022 Community edition
- Qt 5.15.2
- Debug build type "interested in debugging the source"
- Git master branch, no specific tags or commits
I could successfully build and install OCCT with Build_SAMPLES_QT set to FALSE
I tried to install samples with genproj.bat with no luck, then I found Demitry's comment about trying CMake instead.
Now I am trying to build OCCT with Build_SAMPLES_QT set to TRUE, using CMake gui. Here is the status:
1- Configuration and generation work with the following warnings:
=====
CMake Warning at adm/cmake/occt_macros.cmake:265 (message):
FILES has not been found in for package AndroidQt
Call Stack (most recent call first):
adm/cmake/occt_toolkit.cmake:62 (EXTRACT_PACKAGE_FILES)
CMakeLists.txt:89 (include)
samples/qt/AndroidQt/CMakeLists.txt:4 (OCCT_INCLUDE_CMAKE_FILE)
CMake Warning at adm/cmake/occt_macros.cmake:265 (message):
FILES has not been found in for package FuncDemo
Call Stack (most recent call first):
adm/cmake/occt_toolkit.cmake:62 (EXTRACT_PACKAGE_FILES)
CMakeLists.txt:89 (include)
samples/qt/FuncDemo/CMakeLists.txt:4 (OCCT_INCLUDE_CMAKE_FILE)
CMake Warning at adm/cmake/occt_macros.cmake:265 (message):
FILES has not been found in for package IESample
Call Stack (most recent call first):
adm/cmake/occt_toolkit.cmake:62 (EXTRACT_PACKAGE_FILES)
CMakeLists.txt:89 (include)
samples/qt/IESample/CMakeLists.txt:6 (OCCT_INCLUDE_CMAKE_FILE)
CMake Warning at adm/cmake/occt_macros.cmake:265 (message):
FILES has not been found in for package Tutorial
Call Stack (most recent call first):
adm/cmake/occt_toolkit.cmake:62 (EXTRACT_PACKAGE_FILES)
CMakeLists.txt:89 (include)
samples/qt/Tutorial/CMakeLists.txt:6 (OCCT_INCLUDE_CMAKE_FILE)
CMake Warning at adm/cmake/occt_macros.cmake:265 (message):
FILES has not been found in for package OCCTOverview
Call Stack (most recent call first):
adm/cmake/occt_toolkit.cmake:62 (EXTRACT_PACKAGE_FILES)
CMakeLists.txt:89 (include)
samples/qt/OCCTOverview/CMakeLists.txt:5 (OCCT_INCLUDE_CMAKE_FILE)
=====
2- The generation works.
3-Then build fails with with only link errors in the sample projects, the link error looks like this
=====
LINK : error LNK2001: unresolved external symbol mainCRTStartup [C:\occt-all\occt-build-vc-win\samples\qt\AndroidQt\AndroidQt.vcxproj]
C:\occt-all\occt-build-vc-win\win64\vc14\bind\AndroidQt.exe : fatal error LNK1120: 1 unresolved externals [C:\occt-all\occt-build-vc-win\samples\qt\AndroidQt\AndroidQt.vcxproj]
=====
I think I am close because everything else builds successfully.
Key Observations:
- I checked the generated Visual Studio solution, it contains OCCT and the sample qt projects, the sample projects are empty! they don't have any source files. unlike the OCCT components that have everything in place. something to do with the cmake warning above? I guess so
- I traced the cmake code, the warning happens in a cmake module called EXTRACT_PACKAGE_FILES, this function depends on some dynamically created variables that contain the file pathes needed for searching and appending the project files. this part doesn't work with the qt sample projects, my guess is that it doesn't work with samples because sample projects don't generate the dynamically generated variables, that causes the warning mentioned above and makes the file lookup fails.
I could continue hacking around with the cmake code, but it might or might not work eventually.
So please help with your thoughts on how to make it work seamlessly and reliably.
Fri, 05/23/2025 - 09:43
Hello.
At the moment, CMake version of samples is not tested (for 8dev). You can use 7.9 or 7.9.1. Thank you for reporting the problem.
Please build the samples out of the OCCT build: https://github.com/Open-Cascade-SAS/OCCT/tree/master/.github/actions
Best regards, Dmitrii.
Fri, 05/23/2025 - 22:18
Hi Dmitrii, Thanks a lot for your fast response.
Indeed. building 7.9.1 with Build_SAMPLES_QT=ON just works!
I just followed the same steps from above but with 7.9.1 instead of master. turns out that 7.9.1 has more updates in the CMake code.
I didn't try the flow in the GitHub action because I found it using qmake and I am more used to CMake.
appreciate it.
Sat, 05/24/2025 - 00:00
Great that it helps you! The issue on latest master will be fixed on ongoing time. It is result of CMake and repository restructuring.