PeriscopeYun
Looking around for some CAD
Hello everyone,
I am learning open cascade and want to use it with Code::Blocks. I studied Quaoar's Lesson04_HelloOpenCascade from gitlab step by step. It works fine in Visual Studio 2022. But I have been stuck in Code::Blocks for quite a few weeks without success. Below is my whole process, could anyone help me out?
(I know above is the same as what I did with the Settings menu)
Failed again
Then, go to Project->Build options->Linker settings->Link libraries
Add
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKernel.libD:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKMath.lib
I am learning open cascade and want to use it with Code::Blocks. I studied Quaoar's Lesson04_HelloOpenCascade from gitlab step by step. It works fine in Visual Studio 2022. But I have been stuck in Code::Blocks for quite a few weeks without success. Below is my whole process, could anyone help me out?
(1) Downloaded opencascade-7.6.0-vc14-64.exe and installed to D:\OpenCASCADE-7.6.0-vc14-64
(2) Start Code::Blocks 16.01 (already installed) and create a new project, Console Application, and name it “TryOCCT”
(3) Go to menu bar: Settings->Compiler->Search directories->Compiler
Add D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\inc
(4) Similarly, Settings->Compiler->Search directories->Linker
Add D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib
(5) Click OK
(6) Go to
, Lesson04_HelloOpenCascade, Copy and paste the five files into my TryOCCT project: Viewer.h, Viewer.cpp, VIewerInteractor.h, ViewerInteractor.cpp and main.cpp
(7) Build and Run, first error in Viewer.cpp
m_hWnd = CreateWindow(L"OpenGLClass",…
error: cannot convert 'const wchar_t*' to 'LPCSTR {aka const char*}' for argument '2' to 'HWND__* CreateWindowExA(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID)'|
Fix: Change CreateWindow to CreateWindowW (not sure if this is the right way)
(8) Build and Run again, many “undefined reference to…” type errors
Tried go to menu bar, Project->Build options->Search directories->Compiler
Add D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\inc
Project->Build options->Search directories->Linker
Add D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib
(2) Start Code::Blocks 16.01 (already installed) and create a new project, Console Application, and name it “TryOCCT”
(3) Go to menu bar: Settings->Compiler->Search directories->Compiler
Add D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\inc
(4) Similarly, Settings->Compiler->Search directories->Linker
Add D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib
(5) Click OK
(6) Go to
(7) Build and Run, first error in Viewer.cpp
m_hWnd = CreateWindow(L"OpenGLClass",…
error: cannot convert 'const wchar_t*' to 'LPCSTR {aka const char*}' for argument '2' to 'HWND__* CreateWindowExA(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID)'|
Fix: Change CreateWindow to CreateWindowW (not sure if this is the right way)
(8) Build and Run again, many “undefined reference to…” type errors
Tried go to menu bar, Project->Build options->Search directories->Compiler
Add D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\inc
Project->Build options->Search directories->Linker
Add D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib
(I know above is the same as what I did with the Settings menu)
Failed again
Then, go to Project->Build options->Linker settings->Link libraries
Add
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKernel.lib
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKTopAlgo.lib
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKBRep.lib
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKPrim.lib
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKOpenGl.lib
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKV3d.lib
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKService.lib
Nothing changed
Can anyone give me some help? Thanks a lot!
I attached the Code::Blocks project.
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKBRep.lib
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKPrim.lib
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKOpenGl.lib
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKV3d.lib
D:\OpenCASCADE-7.6.0-vc14-64\opencascade-7.6.0\win64\vc14\lib\TKService.lib
Nothing changed
Can anyone give me some help? Thanks a lot!
I attached the Code::Blocks project.