DiscussionsIssue archiveVisualization and 3D Viewer

Archived discussion

Create 3d Viewer problem

Visualization and 3D ViewerTue, 07/04/2023 - 17:047 replies

Browse this forum
QuestionAuthor

I used to create 3d viewer by using OpenCASCADE 7.4 and MSVC 2019.

I got a error at new in below,
MyGraphicDevice = new OpenGl_GraphicDriver(aDisplayConnection);

Can anyone tell me which header file use for new

Please help me to solve this,
View attached image

Discussion

7 archived replies

Posts are displayed in their archived order.

01Author

I request you please hp me to solve.

02Commenter-1

Do you be able to create any other OCCT objects by Handle?

Please check that you include each header files with each classes that used as a method parameters or created.

It looks like you redefine native "new" with something own definition. Please check your code. You can just write "#undef new" before function body.

Best regards, Commenter-1.

03Author

I write #undef new it in my cpp code but it give same error,
I tried to creat a 3d box but it show "no instance of constructor match in argument list"
Error code E0289
For creating graphic driver and display connection.

04Author

I comment out //#define new DEBUG_NEW and include stdlib.h file to project and start debugging it success but it throw error
critical error detected c0000374 at myGraphicDevice = new OpenGl_GraphicDriver(aDisplayConnection);

05Commenter-1

I have no idea what problem is. You need to debug. Please link debug OCCT libs into your project to correct debug process.

Best regards, Commenter-1.

06Commenter-2

I think the problem is the Handle(Aspect_DisplayConnection), it should be assigned with a new Aspect_DisplayConnection() instead of calling its default constructor

07Commenter-3

just mask macro #define new DEBUG_NEW