Erro compiling LibreCad for Window 10 Home

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Erro compiling LibreCad for Window 10 Home

HelloLibre
Hi folks,

I am trying to compile of source code for Window10 and by using Qt Creator 5.0.1
Based on Qt 5.15.2 (MSVC 2019, 64 bit), but I got the following errors:


C:\DEV\misc\mygit\LibreCAD\librecad\src\lib\gui\rs_graphicview.h:65: error: invalid conversion from 'int' to 'Qt::WindowType' [-fpermissive]
In file included from lib\actions\rs_preview.cpp:30:
lib/gui/rs_graphicview.h:65:59: error: invalid conversion from 'int' to 'Qt::WindowType' [-fpermissive]
  RS_GraphicView(QWidget * parent = 0, Qt::WindowFlags f = 0);
                                                           ^

Someone could to help me??

 Long life for LibreCad :-)

thanks in advance
Reply | Threaded
Open this post in threaded view
|

Re: Erro compiling LibreCad for Window 10 Home

LordOfBikes
Administrator
Welcome HelloLibre!

What the compiler criticizes here is:
Qt::WindowFlags f = 0
Because 0 is of type (int) but Qt::WindowFlags is an enum of type (Qt::WindowType).

Thus the compiler expects this:
RS_GraphicView(QWidget * parent = 0, Qt::WindowFlags f = Qt::Widget);
Or even better:
RS_GraphicView(QWidget * parent = nullptr, Qt::WindowFlags f = Qt::Widget);

From your deleted post I've seen, that your tool chain is Qt 6.1.3 with GCC 8.1 64-bit.
Iirc our Windows build server uses Qt 5.12 with bundled 32-bit GCC (don't remember Mingw version from top off my head).

So this could evolve to an endless thread if you don't understand the compiler errors.
Qt 6 could rise issues because of removed, obsolete Qt 5 classes and methods, GCC 8 is presumably the cause for this error because it's more strict and I'm not sure if GCC 64 vs 32 bit can rise issues too.

If you don't necessarily need to compile, I recommend to use our nightly builds which are up to date for Windows at https://sourceforge.net/projects/librecad/files/Windows/NightlyBuilds/master/.

Otherwise I recommend to try an older tool chain from https://download.qt.io/archive/qt/, which is known to build on Windows without issues.

Armin