A question about using OCC

R G W

Active CAD practitioner
Hello everyone, I recently used the OpenCASCADE library in VS2022. When I linked to the library in Debug form in the project, the program ran normally, but when I linked the library in Release/MT form, some methods reported exceptions. , such as the SetUKnots method of the Geom_BSplineSurface class, reports a Standard_ConstructionError exception. The Opencascade library I use is the Release version compiled with version 7.3.0, and the /MT option is also used when compiling. Is there any way to use the Release/MT version?
Thank you so much.
 

R G W

Active CAD practitioner
Okay, now I want to explain this problem in another way. I installed OCC using the windows installer "Open CASCADE Technology installation procedure for Windows" provided on the OCC official website, and then I used VS2022 to build the project. In the project, when I run the program in Debug mode, the program runs normally, but when I run the same program in Release mode, an abnormal error is reported. How can I use OCC correctly in Release mode? By the way, what version of the OCC library is installed using the windows installer? Please give me some help, thank you very much.
 

R G W

Active CAD practitioner
Now there are some new situations. I found that when I construct a TColStd_Array1OfReal in Debug mode, the default element is a small value, such as -6.277e+66; but when I generate the same TColStd_Array1OfReal in Release mode , the default elements are elements from 0 to 1. The following is my code and running results.

TColStd_Array1OfReal uk(1, 57); for (int i = 1; i <= 57; i++) { cout << uk(i) << endl; }

This code only generates a TColStd_Array1OfReal and prints out each element. The printing results are as follows.

Debug:
1701083380443.png

Release:
1701083404161.png

Why is there such a result? If I want to use Release the same as Debug, how should I do it?
 
Top