Fails to build project

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++ standard

set(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 installations

set(OpenCASCADE_DIR "/home/alexander/Documents/openCASCADE/Install/lib/cmake/opencascade") set(VTK_DIR "/home/alexander/Documents/VTK/Install/lib/cmake/vtk-9.2")

Find OpenCASCADE

find_package(OpenCASCADE REQUIRED) include_directories(${OpenCASCADE_INCLUDE_DIR}) message(STATUS "OpenCASCADE_INCLUDE_DIR=${OpenCASCADE_INCLUDE_DIR}")

Find VTK

find_package(VTK REQUIRED)

See libraries

message(STATUS "OpenCASCADE_LIBRARIES=${OpenCASCADE_LIBRARIES}") message(STATUS "VTK_LIBRARIES=${VTK_LIBRARIES}")

Add your source files here

set(SOURCES src/main.cpp #src/your_file.cpp # ... other source files ... )

Add your header files here

set(HEADERS

include/your_header.h

# ... other header files ...

)

Create an executable

add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})

Link the required libraries

target_link_libraries(${PROJECT_NAME} ${OpenCASCADE_LIBRARIES} ${VTK_LIBRARIES} )

Set the RPATH

list(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;

}

"

Dmitrii Pasukhin's picture

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, Dmitrii.

ursusarctos787's picture

Hello, I attached full Cmake file.

Attachments: 
Dmitrii Pasukhin's picture

Could you attache the compiler's output? If not - later I can check your CMake locally.

Best regards, Dmitrii.

ursusarctos787's picture

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