Qt creator reported an error importing Analysis Situs library

JSlyadne

Administrator
Staff member
I suppose the problem lies behind the proper Qt Creator configuration - make sure you let this tool to know where VTK library (dlls, libs and includes) locates.
 

hello

Active CAD practitioner
I suppose the problem lies behind the proper Qt Creator configuration - make sure you let this tool to know where VTK library (dlls, libs and includes) locates.
I compiled the Analysis Situs library with cmake and introduced it into my Qt creator project. There is no problem in simply adding the header file of Analysis Situs library, and my project can run normally. However, as long as I use this library, my program will not run and Iwill be forced to quit.
 

hello

Active CAD practitioner
I suppose the problem lies behind the proper Qt Creator configuration - make sure you let this tool to know where VTK library (dlls, libs and includes) locates.
Whether the functions I write in this library are called or not, it will crash my program, why? Thank you for your answer
 

JSlyadne

Administrator
Staff member
There can be a plenty of reasons for application faulty. To be able to say something meaningful, we need more information - code snippets, stack trace, etc.
 

hello

Active CAD practitioner
There can be a plenty of reasons for application faulty. To be able to say something meaningful, we need more information - code snippets, stack trace, etc.
The first picture is a screenshot of the file I imported into the pro file library, the second picture shows the code did not report errors but the program crashed, and the third picture I commented the code and the program was running again
 

JSlyadne

Administrator
Staff member
If I were you, I would turn on the debugger and examined the code step by step to getting out what exactly the problematic place is. Have you tried to run your application in Debug mode?
 

hello

Active CAD practitioner
When I try to debug, The CDB process terminated
If I were you, I would turn on the debugger and examined the code step by step to getting out what exactly the problematic place is. Have you tried to run your application in Debug mode?
 

hello

Active CAD practitioner
If I were you, I would turn on the debugger and examined the code step by step to getting out what exactly the problematic place is. Have you tried to run your application in Debug mode?
1687396940659.pngI used cmake to compile the generated VS project, which will start normally in the release environment, but not in the debug environment, as shown in the figure. I suspect that this is the cause of the previous problem, but I do not know how to solve it
 

JSlyadne

Administrator
Staff member
View attachment 634I used cmake to compile the generated VS project, which will start normally in the release environment, but not in the debug environment, as shown in the figure. I suspect that this is the cause of the previous problem, but I do not know how to solve it
I suspect there might be a mix of debug and release libraries in your configuration of ASitus. Double-check the paths to 3rd-party dependencies of ASitus which set up for Debug mode.
 

hello

Active CAD practitioner
I suspect there might be a mix of debug and release libraries in your configuration of ASitus. Double-check the paths to 3rd-party dependencies of ASitus which set up for Debug mode.
Which error could cause this problem? I only compiled the Asitus library with cmake. During the compilation process, I only created a build folder to save the generated files and did no other operations.I did the same thing as the picture below.1687422997153.png
 

JSlyadne

Administrator
Staff member
What if you run asiExe.exe in Debug mode? Switch to installation folder (.../bind) and double click on asiExe.exe.
 

hello

Active CAD practitioner
What if you run asiExe.exe in Debug mode? Switch to installation folder (.../bind) and double click on asiExe.exe.
Can you come up with a detailed tutorial (compile for Windows with cmake and VS)? It works fine in either debug or release mode. thank you
 

hello

Active CAD practitioner
My Windows system has installed the full open cascade 7.4 version and added related variables to the environment variables. What should I do if I want to use the open cascade library and Analysis Situs library together? How should environment variables be set? Do I need to compile OCCT separately because OCCT is included in the Analysis Situs library?1687847978509.png
 

JSlyadne

Administrator
Staff member
You are free to compile ASitus against OCCT version you need, for that CMAKE proposes the corresponding variable(s) pointing (3RDPARTY_OCCT_DIR) to the OCCT artifacts such as bins, libs and includes. It's normal practice to patch/customize OCCT and then use it for other projects backed on top of OCCT. ASitus is not an exception here. However, what is quite obvious, you can end up with the compilation errors which you'll need to take care of.

1687931507363.png

Also keep your eyes open to that ASitus is based on OCCT v 7.6 (not v7.4) since some moment.
 

hello

Active CAD practitioner
You are free to compile ASitus against OCCT version you need, for that CMAKE proposes the corresponding variable(s) pointing (3RDPARTY_OCCT_DIR) to the OCCT artifacts such as bins, libs and includes. It's normal practice to patch/customize OCCT and then use it for other projects backed on top of OCCT. ASitus is not an exception here. However, what is quite obvious, you can end up with the compilation errors which you'll need to take care of.

View attachment 643

Also keep your eyes open to that ASitus is based on OCCT v 7.6 (not v7.4) since some moment.
Sorry, I'm new here. I'm not sure I know what you mean. Can I compile the ASitus library and then call the functions of the ASitus and OCCT libraries? Alternatively, I would need to compile both libraries, but I could choose my own installed OCCT as the OCCT dependency when compiling the ASitus library
 

JSlyadne

Administrator
Staff member
You can follow both ways - install OCCT or compile it on your own. What way to go depends on the use-case.

After OCCT is compiled - there are dlls and libs - you can move on to compilation of any project depending on OCCT including ASitus.

Since you have dls, libs and includes of whatever dynamically-linked project (it can be any OCCT, ASitus, etc.), you're able to call its functions in your projects.
 
Top