gkv311 / occt-samples-gtk

Open CASCADE Technology sample - 3D Viewer within GTK window
Other
13 stars 5 forks source link

Can't compile on ALT Linux #5

Closed voodya closed 2 years ago

voodya commented 2 years ago

Cascade version 7.6.0, manually installed with all dependencies. There are no errors when building Cmake, but make throws errors like "undefined reference to". Tried specifying cascade package paths, but that doesn't help. What could be the problem? Snimok_ekrana_v_2022-04-13_22-21-00

gkv311 commented 2 years ago

Are you sure there is no mixture of OCCT libraries installed in the system (e.g. from system repositories + manual build)? Looks like compiler used one headers (from OCCT 7.6), while linker is trying to link to older libraries (7.5) from the first glance...

vatnic commented 2 years ago

Добрый день! У меня подобная проблема тоже на Альте, хотя пробовали и на Fedora, Astra. Вывод консоли такой: dinamon@altfrecad Build $ cmake .. -- Configuring done -- Generating done -- Build files have been written to: /home/dinamon/Projects/occt-gtk-test/Build dinamon@altfrecad Build $ make -j$(nproc --ignore=1) [ 66%] Building CXX object CMakeFiles/occt-gtkmm-test.dir/main.cpp.o [ 66%] Building CXX object CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o [100%] Linking CXX executable occt-gtkmm-test ld: CMakeFiles/occt-gtkmm-test.dir/main.cpp.o: в функции «main»: main.cpp:(.text+0x38): неопределённая ссылка на «OSD::SetSignalStackTraceLength(int)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o: в функции «OcctGtkViewer::onGlAreaRealized()»: OcctGtkViewer.cxx:(.text+0x3e9c): неопределённая ссылка на «OpenGl_GraphicDriver::InitEglContext(void, void, void)» ld: OcctGtkViewer.cxx:(.text+0x416c): неопределённая ссылка на «AIS_InteractiveContext::Display(opencascade::handle const&, int, int, bool, PrsMgr_DisplayStatus)» ld: OcctGtkViewer.cxx:(.text+0x424b): неопределённая ссылка на «AIS_InteractiveContext::Display(opencascade::handle const&, int, int, bool, PrsMgr_DisplayStatus)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o: в функции «OcctGtkViewer::onGlAreaReleased()»: OcctGtkViewer.cxx:(.text+0x47cd): неопределённая ссылка на «V3d_View::Remove()» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV13OcctGtkViewer[_ZTV13OcctGtkViewer]+0x388): неопределённая ссылка на «Aspect_WindowInputListener::update3dMouseTranslation(WNT_HIDSpaceMouse const&)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV13OcctGtkViewer[_ZTV13OcctGtkViewer]+0x390): неопределённая ссылка на «Aspect_WindowInputListener::update3dMouseRotation(WNT_HIDSpaceMouse const&)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV13OcctGtkViewer[_ZTV13OcctGtkViewer]+0x398): неопределённая ссылка на «Aspect_WindowInputListener::update3dMouseKeys(WNT_HIDSpaceMouse const&)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV13OcctGtkViewer[_ZTV13OcctGtkViewer]+0x3a0): неопределённая ссылка на «AIS_ViewController::SelectInViewer(NCollection_Vec2 const&, AIS_SelectionScheme)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV13OcctGtkViewer[_ZTV13OcctGtkViewer]+0x3a8): неопределённая ссылка на «AIS_ViewController::SelectInViewer(NCollection_Sequence<NCollection_Vec2 > const&, AIS_SelectionScheme)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV13OcctGtkViewer[_ZTV13OcctGtkViewer]+0x3b0): неопределённая ссылка на «AIS_ViewController::UpdateRubberBand(NCollection_Vec2 const&, NCollection_Vec2 const&)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV13OcctGtkViewer[_ZTV13OcctGtkViewer]+0x410): неопределённая ссылка на «AIS_ViewController::PickAxis(gp_Pnt&, opencascade::handle const&, opencascade::handle const&, gp_Ax1 const&)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV21Standard_NoSuchObject[_ZTV21Standard_NoSuchObject]+0x40): неопределённая ссылка на «Standard_Failure::GetStackString() const» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV21Standard_NoSuchObject[_ZTV21Standard_NoSuchObject]+0x48): неопределённая ссылка на «Standard_Failure::SetStackString(char const)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV19Standard_OutOfRange[_ZTV19Standard_OutOfRange]+0x40): неопределённая ссылка на «Standard_Failure::GetStackString() const» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV19Standard_OutOfRange[_ZTV19Standard_OutOfRange]+0x48): неопределённая ссылка на «Standard_Failure::SetStackString(char const)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV19Standard_RangeError[_ZTV19Standard_RangeError]+0x40): неопределённая ссылка на «Standard_Failure::GetStackString() const» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV19Standard_RangeError[_ZTV19Standard_RangeError]+0x48): неопределённая ссылка на «Standard_Failure::SetStackString(char const)» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV20Standard_DomainError[_ZTV20Standard_DomainError]+0x40): неопределённая ссылка на «Standard_Failure::GetStackString() const» ld: CMakeFiles/occt-gtkmm-test.dir/OcctGtkViewer.cxx.o:(.data.rel.ro._ZTV20Standard_DomainError[_ZTV20Standard_DomainError]+0x48): неопределённая ссылка на «Standard_Failure::SetStackString(char const*)» collect2: error: ld returned 1 exit status make[2]: [CMakeFiles/occt-gtkmm-test.dir/build.make:116: occt-gtkmm-test] Ошибка 1 make[1]: [CMakeFiles/Makefile2:83: CMakeFiles/occt-gtkmm-test.dir/all] Ошибка 2 make: *** [Makefile:91: all] Ошибка 2 В системе стоит OpenCascade 7.5, я ему в CMakeLists указываю использовать вручную скомпилированную версию 7.6 CMakeLists.txt

gkv311 commented 2 years ago
+set(OpenCASCADE_INCLUDE_myDIR "OCCT/include/opencascade/")
+set(OpenCASCADE_LIBRARY_myDIR "OCCT/lin64/gcc/lib")

Почему здесь указаны относительные пути, вместо ожидаемых абсолютных?

-find_package (OpenCASCADE REQUIRED)
+#find_package (OpenCASCADE REQUIRED)

Почему эта строка закомментирована?

-set (CMAKE_CXX_STANDARD 11)
+set (CMAKE_CXX_STANDARD 23)

Зачем для сборки проекта используется другая версия C++ стандарта?

vatnic commented 2 years ago

Спасибо большое! Прописал абсолютные пути, всё отлично! остальные параметры уже менял в качестве эксперимента... Стыдоба))) будем учиться...