Help compiling nglib onWin
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Help compiling nglib onWin
Due to my ignorance to non-cmake build procedure I need help to compile nglib for windows (and ubuntu )
What do I need to learn? Automake, NMAKE, or Can I launch the MS IDE w/ the .sln file https://github.com/peterl94/clbundler-f ... /netgen.py(might not understand the python here) and chase the linker errors i "Project Properties"?
What do I need to learn? Automake, NMAKE, or Can I launch the MS IDE w/ the .sln file https://github.com/peterl94/clbundler-f ... /netgen.py(might not understand the python here) and chase the linker errors i "Project Properties"?
"fight the good fight"
Re: Help compiling nglib onWin
Unless you have to change compiler flags there is no need to learn automake or nmake. If the source tarball doesn't include a Makefile you have to first run ./configure, then make and make install.
On Windows just enter nmake. If an .sln file is included then use Visual Studio.
On Windows just enter nmake. If an .sln file is included then use Visual Studio.
Re: Help compiling nglib onWin
There is a nglib.sln, so adding the dependencies in the VS IDE to project properties I've come to a problem linking to zlib1.lib Is this the same as zlibstatic.lib in the libpack? I don't see zlib1.h in the downloaded zlib sources (I've only examined the zlib sources I haven't tried to compile it) If so do I need to patch the nglib sources to use this library?wmayer wrote:If an .sln file is included then use Visual Studio.
"fight the good fight"
Re: Help compiling nglib onWin
No, the zlib.lib makes the nglib linking the zlib dll (dynamic linking), while zlibstatic.lib copies all symbols into the nglib.dll (static linking) and makes it slightly bigger. I prefer using the dynamic linking approach.to zlib1.lib Is this the same as zlibstatic.lib in the libpack?
The file is called zlib.h and you can use the version of the libpack.I don't see zlib1.h in the downloaded zlib sources
You don't have to touch the source code. You only have to add search paths for include directories and library files in the project settings.If so do I need to patch the nglib sources to use this library?
Re: Help compiling nglib onWin
This is what I was expecting except the error iswmayer wrote: The file is called zlib.h and you can use the version of the libpack.
Code: Select all
1>------ Build started: Project: nglib, Configuration: Release x64 ------
1>LINK : fatal error LNK1181: cannot open input file 'zlib1.lib'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
"fight the good fight"
Re: Help compiling nglib onWin
It can't find the file zlib1.lib. Depending on the used libpack the file is zlib.lib. In this case just make a copy of it and rename it to zlib1.lib.cannot open input file 'zlib1.lib'
Re: Help compiling nglib onWin
Thanks for the continued support. I get the following nowwmayer wrote:It can't find the file zlib1.lib. Depending on the used libpack the file is zlib.lib. In this case just make a copy of it and rename it to zlib1.lib.
Code: Select all
Error 2 error MSB3073: The command ""C:\Users\Chris\GitHub\netgen-mesher-git-cf713efd2da43a733abf06f7c9b5c9697fef7e78\windows\\postBuild_nglib.bat" "nglib" "nglib.dll" "Release" "x64" "C:\Users\Chris\GitHub\netgen-mesher-git-cf713efd2da43a733abf06f7c9b5c9697fef7e78\windows\"
:VCEnd" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets 132 5 nglib
"fight the good fight"
Re: Help compiling nglib onWin
It looks like it wanted to copy the files to a certain place which failed for any reason. But since it created the files it doesn't matter.Thanks for the continued support. I get the following now
Re: Help compiling nglib onWin
Because there is not an install target a post build script is run that tries to copy the files to a write protected location (admin privileges are required)wmayer wrote:It looks like it wanted to copy the files to a certain place which failed for any reason. But since it created the files it doesn't matter.
Thanks again for the help.
"fight the good fight"
Re: Help compiling nglib onWin
Latest attempt:
1. Downloaded netgen 5.1 snapshot from here: https://sourceforge.net/p/netgen-mesher ... -5.1/tree/
2. Applied changes as explained here: viewtopic.php?f=17&p=127000#p126997
3. Build nglib, Copy and Replace nglib.dll, nglib.lib, nglib.h, and the changed .hpp files over existing locations in the libpack.
Scratch build FreeCAD
Do I need to apply additional patches? like here: https://github.com/peterl94/clbundler-f ... hes/netgen
EDIT: Or could I have some sort of circular dependency issue. I'm building nglib with the provided nglib.sln file in the netgen windows folder, and adding the paths to link against the existing libpack when VS complains, could VS be using the unmodified header files from the existing libpack instead of the modified ones in the netgen libsrc's?
1. Downloaded netgen 5.1 snapshot from here: https://sourceforge.net/p/netgen-mesher ... -5.1/tree/
2. Applied changes as explained here: viewtopic.php?f=17&p=127000#p126997
3. Build nglib, Copy and Replace nglib.dll, nglib.lib, nglib.h, and the changed .hpp files over existing locations in the libpack.
Scratch build FreeCAD
Code: Select all
Error 2 error C2375: 'netgen::OCCGenerateMesh' : redefinition; different linkage C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_Mesher.cpp 87 1 NETGENPlugin
Error 3 error C2568: '=' : unable to resolve function overload C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_Mesher.cpp 2505 1 NETGENPlugin
Error 4 error C2568: '=' : unable to resolve function overload C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_Mesher.cpp 2606 1 NETGENPlugin
Error 5 error C2568: '=' : unable to resolve function overload C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_Mesher.cpp 2647 1 NETGENPlugin
Error 6 error C2568: '=' : unable to resolve function overload C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_Mesher.cpp 2757 1 NETGENPlugin
Error 7 error C2568: '=' : unable to resolve function overload C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_Mesher.cpp 2859 1 NETGENPlugin
Error 8 error C2568: '=' : unable to resolve function overload C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_Mesher.cpp 2891 1 NETGENPlugin
Error 9 error C2440: 'initializing' : cannot convert from 'int (__cdecl *)(netgen::OCCGeometry &,netgen::Mesh *&,netgen::MeshingParameters &,int,int)' to 'int' C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_Mesher.cpp 3113 1 NETGENPlugin
Error 11 error C2375: 'netgen::OCCGenerateMesh' : redefinition; different linkage C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_NETGEN_2D_ONLY.cpp 70 1 NETGENPlugin
Error 12 error C2568: '=' : unable to resolve function overload C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_NETGEN_2D_ONLY.cpp 478 1 NETGENPlugin
Error 14 error C2375: 'netgen::OCCGenerateMesh' : redefinition; different linkage C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_NETGEN_3D.cpp 79 1 NETGENPlugin
Error 15 error C2568: '=' : unable to resolve function overload C:\Users\Chris\GitHub\FreeCAD\src\3rdParty\salomesmesh\src\NETGENPlugin\NETGENPlugin_NETGEN_3D.cpp 475 1 NETGENPlugin
Error 16 error LNK1181: cannot open input file '..\..\..\..\lib\Release\NETGENPlugin.lib' C:\Users\Chris\GitHub\FCNG-build\src\Mod\MeshPart\App\LINK MeshPart
Error 17 error LNK1181: cannot open input file '..\..\..\..\lib\Release\NETGENPlugin.lib' C:\Users\Chris\GitHub\FCNG-build\src\Mod\Fem\App\LINK Fem
Error 18 error LNK1181: cannot open input file '..\App\Release\MeshPart.lib' C:\Users\Chris\GitHub\FCNG-build\src\Mod\MeshPart\Gui\LINK MeshPartGui
Error 19 error LNK1181: cannot open input file '..\App\Release\Fem.lib' C:\Users\Chris\GitHub\FCNG-build\src\Mod\Fem\Gui\LINK FemGui
EDIT: Or could I have some sort of circular dependency issue. I'm building nglib with the provided nglib.sln file in the netgen windows folder, and adding the paths to link against the existing libpack when VS complains, could VS be using the unmodified header files from the existing libpack instead of the modified ones in the netgen libsrc's?
"fight the good fight"