Create 3d Viewer problem

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

Parmar Ronit's picture

I request you please hp me to solve.

Dmitrii Pasukhin's picture

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

Parmar Ronit's picture

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.

Attachments: 
Parmar Ronit's picture

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);

Dmitrii Pasukhin's picture

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

lei hu's picture

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

言 诺's picture

just mask macro #define new DEBUG_NEW