Help compiling nglib onWin

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
sgrogan
Posts: 5201
Joined: Wed Oct 22, 2014 5:02 pm

Re: Help compiling nglib onWin

Postby sgrogan » Tue Oct 04, 2016 10:10 pm

wmayer wrote:Here is the patch.
I think I'm close. VS couldn't find pthreadVC2_64.lib because it doesn't exist on my system. I made a copy of pthreadVC2.lib and renamed it. Then I have the following.

Code: Select all

1>------ Build started: Project: nglib, Configuration: Release(OCC) x64 ------
1>     Creating library C:\Users\Chris\GitHub\netgen-mesher-git\windows\nglib\x64\Release(OCC)\nglib.lib and object C:\Users\Chris\GitHub\netgen-mesher-git\windows\nglib\x64\Release(OCC)\nglib.exp
1>gzstream.obj : error LNK2001: unresolved external symbol gzread
1>gzstream.obj : error LNK2001: unresolved external symbol gzwrite
1>gzstream.obj : error LNK2001: unresolved external symbol gzclose
1>gzstream.obj : error LNK2001: unresolved external symbol gzopen
1>C:\Users\Chris\GitHub\netgen-mesher-git\windows\nglib\x64\Release(OCC)\nglib.dll : fatal error LNK1120: 4 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
wmayer
Site Admin
Posts: 14426
Joined: Thu Feb 19, 2009 10:32 am

Re: Help compiling nglib onWin

Postby wmayer » Wed Oct 05, 2016 7:20 am

You have to pass the zlib to the linker.
User avatar
sgrogan
Posts: 5201
Joined: Wed Oct 22, 2014 5:02 pm

Re: Help compiling nglib onWin

Postby sgrogan » Wed Oct 05, 2016 8:33 pm

wmayer wrote:You have to pass the zlib to the linker.
In project properties, Linker>General tab I have added the directory containing zlib.lib to "Additional Library Directories" already.
wmayer
Site Admin
Posts: 14426
Joined: Thu Feb 19, 2009 10:32 am

Re: Help compiling nglib onWin

Postby wmayer » Thu Oct 06, 2016 7:02 am

But you also have to add zlib.lib as additional dependency.
User avatar
sgrogan
Posts: 5201
Joined: Wed Oct 22, 2014 5:02 pm

Re: Help compiling nglib onWin

Postby sgrogan » Thu Oct 06, 2016 11:48 pm

wmayer wrote:But you also have to add zlib.lib as additional dependency.
Duh! Thanks :)
add pthreadVC2_64, zlib, and occt7 to the additional dependencies and nglib builds.
Then compiling FreeCAD

Code: Select all

Error	2	error C2370: 'netgen::multithread' : redefinition; different storage class	C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_Mesher.cpp	93	1	NETGENPlugin
Error	4	error C2375: 'netgen::OCCSetLocalMeshSize' : redefinition; different linkage	C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_NETGEN_2D_ONLY.cpp	75	1	NETGENPlugin
Error	6	error C2370: 'netgen::multithread' : redefinition; different storage class	C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_NETGEN_3D.cpp	84	1	NETGENPlugin
Error	7	error LNK1181: cannot open input file '..\..\..\..\lib\Release\NETGENPlugin.lib'	C:\Users\Chris\GitHub\FreeCAD-build\src\Mod\MeshPart\App\LINK	MeshPart
Error	8	error LNK1181: cannot open input file '..\..\..\..\lib\Release\NETGENPlugin.lib'	C:\Users\Chris\GitHub\FreeCAD-build\src\Mod\Fem\App\LINK	Fem
Error	9	error LNK1181: cannot open input file '..\App\Release\MeshPart.lib'	C:\Users\Chris\GitHub\FreeCAD-build\src\Mod\MeshPart\Gui\LINK	MeshPartGui
Error	10	error LNK1181: cannot open input file '..\App\Release\Fem.lib'	C:\Users\Chris\GitHub\FreeCAD-build\src\Mod\Fem\Gui\LINK	FemGui
User avatar
sgrogan
Posts: 5201
Joined: Wed Oct 22, 2014 5:02 pm

Re: Help compiling nglib onWin

Postby sgrogan » Wed Nov 02, 2016 2:30 pm

sgrogan wrote:Error 2 error C2370: 'netgen::multithread' : redefinition; different storage class C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_Mesher.cpp 93 1 NETGENPlugin
Ahh, I hadn't seen this git commit 356723f I need to try again.
amartin7211
Posts: 1
Joined: Sat Jan 21, 2017 2:56 pm

Re: Help compiling nglib onWin

Postby amartin7211 » Sat Jan 21, 2017 7:43 pm

I too am trying to compile FreeCAD on windows and have run into some errors with NETGENPlugin_Mesher.

Here is one error that is repeated dozens of times for me:

Code: Select all

Error	1	error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl netgen::Point<3>::Point<3>(double,double,double)" (__imp_??0?$Point@$02@netgen@@QEAA@NNN@Z) referenced in function "public: static void __cdecl NETGENPlugin_Mesher::AddIntVerticesInFaces(class netgen::OCCGeometry const &,class netgen::Mesh &,class std::vector<class SMDS_MeshNode const *,class std::allocator<class SMDS_MeshNode const *> > &,class NETGENPlugin_Internals &)" (?AddIntVerticesInFaces@NETGENPlugin_Mesher@@SAXAEBVOCCGeometry@netgen@@AEAVMesh@3@AEAV?$vector@PEBVSMDS_MeshNode@@V?$allocator@PEBVSMDS_MeshNode@@@std@@@std@@AEAVNETGENPlugin_Internals@@@Z)	R:\Coding\FreeCADBuild_w_Netgen\build\src\3rdParty\salomesmesh\NETGENPlugin_Mesher.obj	NETGENPlugin
Any chance you have made more progress on this topic?
User avatar
shaise
Posts: 338
Joined: Thu Jun 11, 2015 8:11 am

Re: Help compiling nglib onWin

Postby shaise » Fri Mar 03, 2017 4:59 pm

sgrogan wrote:Error 2 error C2370: 'netgen::multithread' : redefinition; different storage class C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_Mesher.cpp 95 1 NETGENPlugin
Sgrogan,
Did you solve it? have the same issue.
shai
User avatar
sgrogan
Posts: 5201
Joined: Wed Oct 22, 2014 5:02 pm

Re: Help compiling nglib onWin

Postby sgrogan » Fri Mar 03, 2017 10:52 pm

shaise wrote:Did you solve it? have the same issue.
Not yet. blacey gave me a patch for ng 5.3.1, but I'm am trying to upgrade OCCT to 7.1 first so I don't have to do it twice. For now we still need to disable BUILD_FEM_NETGEN with CMake.