FreeCAD 0.20 bulid with Win11 VS2022

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
djxiaoaa
Posts: 5
Joined: Wed Jun 22, 2022 7:40 pm

FreeCAD 0.20 bulid with Win11 VS2022

Post by djxiaoaa »

Hello everyone,
I'm new here. I have clone the last official 0.20 version from git and build it with the new LibPack on window 11.

Everything is ok. But when I run FreeCAD and try to open an existing file, the application has got a CD at "src\vcruntime\delete_scalar.cpp".

Here is the stack:

Code: Select all

 	ntdll.dll!00007ff9bdc0726e()	Unknown
 	ntdll.dll!00007ff9bdbcdef6()	Unknown
 	ntdll.dll!00007ff9bdb7bc91()	Unknown
 	KernelBase.dll!00007ff9bb67cd7b()	Unknown
 	ucrtbased.dll!00007ff91a7ce852()	Unknown
 	ucrtbased.dll!00007ff91a7cca91()	Unknown
 	ucrtbased.dll!00007ff91a7d0275()	Unknown
>	Part_d.pyd!operator delete(void * block) Line 38	C++
 	Part_d.pyd!operator delete[](void * block) Line 32	C++
 	Part_d.pyd!NCollection_Array1<int>::~NCollection_Array1<int>() Line 435	C++
 	[External Code]	
 	Part_d.pyd!Part::Tools::getPointNormals(const TopoDS_Face & theFace, opencascade::handle<Poly_Triangulation> aPolyTri, NCollection_Array1<gp_Dir> & theNormals) Line 577	C++
 	PartGui_d.pyd!PartGui::ViewProviderPartExt::updateVisual() Line 1080	C++
 	PartGui_d.pyd!PartGui::ViewProviderPartExt::onChanged(const App::Property * prop) Line 367	C++
 	PartDesignGui_d.pyd!PartDesignGui::ViewProviderBody::onChanged(const App::Property * prop) Line 398	C++
 	FreeCADApp_d.dll!App::Property::hasSetValue() Line 232	C++
I have built the 0.19 version, there was no problem. Does anyone can help? Thanks in advance.
djxiaoaa
Posts: 5
Joined: Wed Jun 22, 2022 7:40 pm

Re: FreeCAD 0.20 bulid with Win11 VS2022

Post by djxiaoaa »

Hello,
Update for this topic. The CD is only reproduceable with Debug Build.

And everything is ok for the moment with Release Build.

Code: Select all

void __CRTDECL operator delete(void* const block) noexcept
{
    #ifdef _DEBUG
    _free_dbg(block, _UNKNOWN_BLOCK);
    #else
    free(block);
    #endif
}
User avatar
adrianinsaval
Veteran
Posts: 5541
Joined: Thu Apr 05, 2018 5:15 pm

Re: FreeCAD 0.20 bulid with Win11 VS2022

Post by adrianinsaval »

@wmayer check this out, is the debug code wrong?
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: FreeCAD 0.20 bulid with Win11 VS2022

Post by wmayer »

Something with OCC must be wrong. I had exactly the same problem some years ago with a debug build but I cannot remember if I found the root problem. I had the problem with a pre-built OCC version of the LibPack but a locally built OCC version worked fine.

Are you sure that you use the OCC debug build for the FreeCAD debug build?
djxiaoaa
Posts: 5
Joined: Wed Jun 22, 2022 7:40 pm

Re: FreeCAD 0.20 bulid with Win11 VS2022

Post by djxiaoaa »

Thank you for the information.

I just followed the step on the wiki page to build the FreeCAD 0.20 with the new version LibPack (https://github.com/FreeCAD/FreeCAD-LibP ... es/tag/2.6).

What do you mean OCC debug build, is there an option in cmake configuration ?
wangzijun77
Posts: 1
Joined: Tue Jul 26, 2022 9:49 am

Re: FreeCAD 0.20 bulid with Win11 VS2022

Post by wangzijun77 »

Yes, this is a problem related to occ 7.6+, it will be gone if you use those libpacks with occ7.5.3
djxiaoaa
Posts: 5
Joined: Wed Jun 22, 2022 7:40 pm

Re: FreeCAD 0.20 bulid with Win11 VS2022

Post by djxiaoaa »

wangzijun77 wrote: Tue Jul 26, 2022 9:51 am Yes, this is a problem related to occ 7.6+, it will be gone if you use those libpacks with occ7.5.3
Thanks. That means I can build the 0.20 with the old LibPack 1.x version?

To be honest, I'm a bit curious as to how their FreeCAD programmers work when it comes to 0.20 with 2.x version LibPack. Compiling without debug mode is a real pain.
laien1900
Posts: 1
Joined: Tue Sep 13, 2022 2:20 am

Re: FreeCAD 0.20 bulid with Win11 VS2022

Post by laien1900 »

I fix this by copying LibPack-OCC76-V2\bind into the build path bin(debug) folder. I think you should gengerate [debug] and [release] to different folder
Post Reply