Building Libs for Windows Debug Version with VS2017/Qt5.12

Having trouble installing or compiling FreeCAD? Get help here.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by sgrogan »

apeltauer wrote: Tue Mar 19, 2019 1:54 pm I hope someone can test the libpack and can tell me if it works...
I tried to build with your tag,
In CMake I had to manually set all the boost lib paths (I only set the release paths), the includes were detected automatically.
I then had to set the QT5 flag.
Running VS2017 Release x64
gives the following errors

Code: Select all

Severity	Code	Description	Project	File	Line	Suppression State
Error	C2057	expected constant expression	FreeCADGui	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\vector	682	
Error	C1903	unable to recover from previous error(s); stopping compilation	FreeCADGui	C:\Users\Chris\GitHub\FreeCADA\src\Gui\ViewProviderPythonFeature.cpp	1081	
Error	LNK1181	cannot open input file '..\Gui\Release\FreeCADGui.lib'	FreeCADMain	C:\Users\Chris\GitHub\buildlp12\src\Main\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	PointsGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Points\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	InspectionGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Inspection\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	QtUnitGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Test\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	ImageGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Image\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	StartGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Start\Gui\LINK	1	
Error	C2057	expected constant expression	MeshGui	C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\vector	682	
Error	C1903	unable to recover from previous error(s); stopping compilation	MeshGui	C:\Users\Chris\GitHub\FreeCADA\src\Mod\Mesh\Gui\ViewProviderPython.cpp	29	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	ReverseEngineeringGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\ReverseEngineering\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\Gui\Release\FreeCADGui.lib'	FreeCADGuiPy	C:\Users\Chris\GitHub\buildlp12\src\Main\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	SpreadsheetGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Spreadsheet\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	DrawingGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Drawing\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	RobotGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Robot\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	RaytracingGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Raytracing\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	PartGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Part\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\Part\Gui\Release\PartGui.lib'	ImportGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Import\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\Part\Gui\Release\PartGui.lib'	MeshPartGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\MeshPart\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\Part\Gui\Release\PartGui.lib'	SurfaceGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Surface\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\Part\Gui\Release\PartGui.lib'	PathGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Path\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\..\Gui\Release\FreeCADGui.lib'	TechDrawGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\TechDraw\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\Part\Gui\Release\PartGui.lib'	SketcherGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\Sketcher\Gui\LINK	1	
Error	LNK1181	cannot open input file '..\..\Sketcher\Gui\Release\SketcherGui.lib'	PartDesignGui	C:\Users\Chris\GitHub\buildlp12\src\Mod\PartDesign\Gui\LINK	1	
"fight the good fight"
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer »

Thanks for testing.
Set Qt5 depends on the main cmak file in line 180

Code: Select all

    IF(DEFINED ENV{FREECAD_LIBPACK_DIR})
      set(FREECAD_LIBPACK_DIR $ENV{FREECAD_LIBPACK_DIR} CACHE PATH  "Directory of the FreeCAD LibPack")
      MESSAGE(STATUS "Found libpack env variable: ${FREECAD_LIBPACK_DIR}")
      IF(EXISTS ${FREECAD_LIBPACK_DIR}/lib/Qt53DCore.lib)
        OPTION(BUILD_QT5 "Build with Qt5." ON)
So basically if you set a environment variable named "FREECAD_LIBPACK_DIR" to to the libpack qt5 should be enabled.
Can you please test this first? Right now cant understand why the boost stuff is not found automatically...
Can you please have a look why the project "FreeCADGui" cant be build? I thinks this fails your build...
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by sgrogan »

apeltauer wrote: Wed Mar 20, 2019 6:02 am So basically if you set a environment variable named "FREECAD_LIBPACK_DIR" to to the libpack qt5 should be enabled.
Males sense. I either set the path in cmake-gui or pass as a command line switch. It's a minor inconvience for me to set an environment variable because I'm using VS2013/15/17 32 and 64 bit. I will check if setting the variable makes a difference with finding the boost libs.
apeltauer wrote: Wed Mar 20, 2019 6:02 am Can you please have a look why the project "FreeCADGui" cant be build? I thinks this fails your build...
From my error above it had something to do with the C++ runtimes, updating VS2017 fixed it.

I only get an error for the Web WB when running the self-tests, no Ship error.

Did you build QT with SSL support? I don't see the dll's. At least when using QTWebkit ssl is required by the Start page.

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16182 (Git)
Build type: Release
Branch: (HEAD detached at LibPack_12.1.1)
Hash: c01936fa495456fcb52b4e78f859c78e82bc9095
Python version: 3.7.2
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
"fight the good fight"
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer »

Sounds good so far... :)
I didn’t build qt myself, I used the pre build of qt which can be downloaded by qt...
I will check the ssl stuff tomorrow...
User avatar
sgrogan
Veteran
Posts: 6499
Joined: Wed Oct 22, 2014 5:02 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by sgrogan »

apeltauer wrote: Wed Mar 20, 2019 9:33 pm I didn’t build qt myself, I used the pre build of qt which can be downloaded by qt...
I will check the ssl stuff tomorrow...
It's built without ssl.

Amazing work here :) Thanks :D

Do you have any desire to build (or direct me) to build a 32 bit version? I don't think we would need the debug libs.
"fight the good fight"
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer »

sgrogan wrote: Wed Mar 20, 2019 9:45 pm Do you have any desire to build (or direct me) to build a 32 bit version? I don't think we would need the debug libs.
No, not really... :)
Just compiling the binaries is just one thing, but with all the python stuff, pyside2, pivy,.... this is another big task...

I just cleaned my github repo.
The cmake changes are store here (https://github.com/apeltauer/FreeCAD/tr ... ibpack_v12)
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by wmayer »

apeltauer wrote: Wed Mar 20, 2019 9:33 pm Sounds good so far... :)
I didn’t build qt myself, I used the pre build of qt which can be downloaded by qt...
I will check the ssl stuff tomorrow...
The Qt binaries you get with the installer have SSL support enabled. In case SSL doesn't work then maybe you forgot to add the OpenSSL dlls to the LibPack. When looking at the dependencies of the QtNetwork module (using the Dependency Walker) there shouldn't be listed the OpenSSL dlls. Instead they are loaded fully dynamically at runtime.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by wmayer »

apeltauer wrote: Thu Mar 21, 2019 6:45 am The cmake changes are store here (https://github.com/apeltauer/FreeCAD/tr ... ibpack_v12)
It makes sense to automatically activate the Qt5 option in case the LibPack includes Qt5 stuff. However, you shouldn't check for Qt53DCore because in FreeCAD we don't use Qt3D and there is no guarantee that all future LibPacks offer this file. Better you check for Qt5Core.

At the moment the top-level CMake file duplicates a lot of code to find the needed libraries. There is the standard way how it's done on all Linux distribution and there is this option FREECAD_LIBPACK_USE. Years ago peterl94 had the great idea to harmonize this a bit using the CLBundler project which allows is to use the LibPack the way how it's done on Linux.
Therefore I would like to remove all the duplicated code.

Now in order to identify your LibPack you only have to add the file MANIFEST.db to the root directory of the LibPack.

The changes you made for FindOpenCasCade.cmake are problematic because this will make it fail on other OS than Windows because there is no distinction in the file namen between release and debug versions.
User avatar
apeltauer
Posts: 399
Joined: Fri Aug 11, 2017 2:19 pm

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by apeltauer »

wmayer wrote: Thu Mar 21, 2019 8:26 am It makes sense to automatically activate the Qt5 option in case the LibPack includes Qt5 stuff. However, you shouldn't check for Qt53DCore because in FreeCAD we don't use Qt3D and there is no guarantee that all future LibPacks offer this file. Better you check for Qt5Core.
Will change this to Qt5Core...
wmayer wrote: Thu Mar 21, 2019 8:26 am At the moment the top-level CMake file duplicates a lot of code to find the needed libraries. There is the standard way how it's done on all Linux distribution and there is this option FREECAD_LIBPACK_USE. Years ago peterl94 had the great idea to harmonize this a bit using the CLBundler project which allows is to use the LibPack the way how it's done on Linux.
Therefore I would like to remove all the duplicated code.
Now in order to identify your LibPack you only have to add the file MANIFEST.db to the root directory of the LibPack.
You are totally right with the duplicated code. I just dont know what the manifest contains and how it was build.
I try to use the CLBundler cmake file and make my changes their.
wmayer wrote: Thu Mar 21, 2019 8:26 am The changes you made for FindOpenCasCade.cmake are problematic because this will make it fail on other OS than Windows because there is no distinction in the file namen between release and debug versions.
Will change this back and make a use case if "FREECAD_LIBPACK_USE" then....
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Building Libs for Windows Debug Version with VS2017/Qt5.12

Post by wmayer »

You are totally right with the duplicated code. I just dont know what the manifest contains and how it was build.
I don't know but it may suffice to create a dummy file with this name. AFAIK inside the cmake file it's only tested for the existence of the files but not its content.
Post Reply