Hello, could you send full Cmake? The current sample very difficult to analyze.
But looks like that you don't linking occt's 3rd-parties.
Best regards, Commenter-1.
Archived discussion
Hello, im new to OCCT and was trying to follow the bottle tutorial. However im failing at building the project (with both make, and VS code), even though im not that far into the tutorial. Any idea what is wrong? Thanks!
This is my CMakeLists.txt:
" cmake_minimum_required(VERSION 3.20) project(Bottle)
Set C++ standardset(CMAKE_CXX_STANDARD 17)
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_INSTALL_PREFIX "/home/alexander/Documents/bottleTutorial/install")
Set the paths to OpenCASCADE and VTK installationsset(OpenCASCADE_DIR "/home/alexander/Documents/openCASCADE/Install/lib/cmake/opencascade") set(VTK_DIR "/home/alexander/Documents/VTK/Install/lib/cmake/vtk-9.2")
Find OpenCASCADEfind_package(OpenCASCADE REQUIRED) include_directories(${OpenCASCADE_INCLUDE_DIR}) message(STATUS "OpenCASCADE_INCLUDE_DIR=${OpenCASCADE_INCLUDE_DIR}")
Find VTKfind_package(VTK REQUIRED)
See librariesmessage(STATUS "OpenCASCADE_LIBRARIES=${OpenCASCADE_LIBRARIES}") message(STATUS "VTK_LIBRARIES=${VTK_LIBRARIES}")
Add your source files hereset(SOURCES src/main.cpp #src/your_file.cpp # ... other source files ... )
Add your header files hereset(HEADERS
include/your_header.h # ... other header files ...)
Create an executableadd_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
Link the required librariestarget_link_libraries(${PROJECT_NAME} ${OpenCASCADE_LIBRARIES} ${VTK_LIBRARIES} )
Set the RPATHlist(APPEND RPATH_LIST "/home/alexander/Documents/openCASCADE/Install/lib" "/home/alexander/Documents/VTK/Install/lib" ) set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "${RPATH_LIST}")
"
And this is the simple main.cpp:
"
include<gp_Pnt.hxx>int main() {
double myWidth = 20;
double myHeight = 25;
double myThickness = 7;
gp_Pnt aPnt1(-myWidth / 2., 0, 0);
gp_Pnt aPnt2(-myWidth / 2., -myThickness / 4., 0);
gp_Pnt aPnt3(0, -myThickness / 2., 0);
gp_Pnt aPnt4(myWidth / 2., -myThickness / 4., 0);
gp_Pnt aPnt5(myWidth / 2., 0, 0);
return 0;
}
"
Discussion
Posts are displayed in their archived order.
Hello, could you send full Cmake? The current sample very difficult to analyze.
But looks like that you don't linking occt's 3rd-parties.
Best regards, Commenter-1.
Hello, I attached full Cmake file.
Could you attache the compiler's output? If not - later I can check your CMake locally.
Best regards, Commenter-1.
the compiler just wont get through with the linking. It hangs here:
Consolidate compiler generated dependencies of target Bottle
[ 50%] Linking CXX executable Bottle
Thanks! /UA