Help compiling nglib onWin

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
peterl94
Veteran
Posts: 1001
Joined: Thu May 23, 2013 7:31 pm
Location: United States

Re: Help compiling nglib onWin

Post by peterl94 »

'netgen::OCCGenerateMesh' : redefinition; different linkage
Must mean it is declared differently in nglib and FreeCAD (occgeom.hpp and NETGENPlugin_Mesher.cpp)

In this case, I would apply my changes to occgeom.hpp in addition to wmayer's. (At least export the OCCGenerateMesh function, I don't remember if exporting the OCCGeometry class is necessary.)

Code: Select all

--- netgen-5.1/libsrc/occ/occgeom.hpp	Tue Jun 25 04:28:59 2013
+++ netgen-5.1_new/libsrc/occ/occgeom.hpp	Fri Jul 11 00:38:32 2014
@@ -189,7 +189,7 @@
 
 
 
-   class OCCGeometry : public NetgenGeometry
+   class DLL_HEADER OCCGeometry : public NetgenGeometry
    {
       Point<3> center;
 
@@ -435,7 +435,7 @@
    // Philippose - 31.09.2009
    // External access to the mesh generation functions within the OCC
    // subsystem (Not sure if this is the best way to implement this....!!)
-   extern int OCCGenerateMesh (OCCGeometry & occgeometry, Mesh*& mesh,
+   DLL_HEADER extern int OCCGenerateMesh (OCCGeometry & occgeometry, Mesh*& mesh,
 			       MeshingParameters & mparam,
 			       int perfstepsstart, int perfstepsend);
 
Keep in mind I was patching for an older version of smesh. Is smesh7 the version that is included in the FreeCAD source now? I haven't kept track of what has been going on with that.
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Help compiling nglib onWin

Post by sgrogan »

peterl94 wrote:Keep in mind I was patching for an older version of smesh. Is smesh7 the version that is included in the FreeCAD source now? I haven't kept track of what has been going on with that.
Yes, SMESH 7.7.1 and OCCT 7.0
I chased the errors that look like they relate to your patch, and have individually applied the entire dllexport.diff in addition to wmayers changes and still have unresolved externals. I unfortunately was just hacking the downloaded snapshot. I'll reproduce on a git repo with commits and push the branch so at least we are looking at the same source.
"fight the good fight"
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Help compiling nglib onWin

Post by sgrogan »

I'm stuck :(
@wmayer, can you post your patched netgen sources somewhere?
I've tried applying wmayer's patches to the bare netgen 5.1 code, with and without PeterL94's previous patches. I've tried vejmarie's netgen 5.3 fork, looo's 6.x fork. I can't succeed. I know NormandC is trying to bring OCCT7 support to Ubuntu. We'll need to recompile netgen against that, it would be good to use the same version for the 3 OS's.
Any help is greatly appreciated.
"fight the good fight"
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Help compiling nglib onWin

Post by looo »

what was the problem with 6.? have you used cmake? which occ you use?
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Help compiling nglib onWin

Post by wmayer »

sgrogan wrote:@wmayer, can you post your patched netgen sources somewhere?
OK. I will prepare a patch.
looo wrote:what was the problem with 6.? have you used cmake? which occ you use?
Building netgen 6 on Windows is even more complicated. I quickly tried it and got tons of errors so I gave up immediately.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: Help compiling nglib onWin

Post by looo »

There are many "windows conditionals" in the netgen cmake, so I thought compiling on windows is supported...
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Help compiling nglib onWin

Post by sgrogan »

wmayer wrote:OK. I will prepare a patch.
Thanks :)
looo wrote:what was the problem with 6.? have you used cmake? which occ you use?
I used your netgen branch cmake and OCCT 7.0.0
I'll reproduce this weekend and post the errors. There were not too many if IIRC.
"fight the good fight"
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Help compiling nglib onWin

Post by sgrogan »

When compiling looo's netgen branch https://github.com/looooo/netgen, linking against current 11.5.2 libpack, errors for just building the nglib project

Code: Select all

Error	6	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\netgen\libsrc\general\mysimd.hpp	52	1	nglib
Error	7	error C2144: syntax error : 'int' should be preceded by ';'	c:\users\chris\github\netgen\libsrc\general\mysimd.hpp	167	1	nglib
Error	8	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\chris\github\netgen\libsrc\general\mysimd.hpp	167	1	nglib
Error	12	error C2487: 'Print' : member of dll interface class may not be declared with dll interface	c:\users\chris\github\netgen\libsrc\meshing\meshtype.hpp	1134	1	nglib
"fight the good fight"
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Help compiling nglib onWin

Post by wmayer »

Here is the patch.
Attachments
netgen.zip
(1.48 KiB) Downloaded 100 times
wmayer
Founder
Posts: 20241
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Help compiling nglib onWin

Post by wmayer »

This explains the failures with it: http://stackoverflow.com/questions/2026 ... -in-vc2013
msvc 2013 does not support constexpr which came with C++11.
Post Reply