Solved Qt 5.12.0 MSVC 2017 32 Bit
-
Sorry I was not clear. Those lines are in winnt.h in the Windows Kits 10. It is not something I have added. They do not appear in Windows Kits 8.
A minimal app in VS2017 seems to compile ok with winnt.h included.
Thanks for your help.
Brian
-
So what is your actual problem, i.e. when do you hit that compile error?
-
Hi, SHA1 is an enum in Qt (qtbase/src/3rdparty/rfc6234/sha.h):
typedef enum SHAversion { SHA1, SHA224, SHA256, SHA384, SHA512 } SHAversion;
Perhaps there's a name collision occurring?
-
My simple test was to comment out the lines in winnt.h which is obviously a bad idea but it did allow me to compile and run my program.
Any ideas how I can progress further in resolving this in a clean way?
Thanks
-
There must be a file in your program where both headers (winnt.h and sha.h) are both included (direct or indirectly). You need to first find out where this happens.
Then maybe you can work with namespaces to silent this error.
-
I have no direct include for "sha.h" so I was trying to figure out how to add /showincludes as an option.
Is there anyway to get a full view of all included files?
Thanks
Brian
-
Hi, turns out Qt is innocent (that sha.h is just a 3rdparty file).
I think it's a #define in your program that's the culprit. I created a new empty vanilla Qt Widgets program and changed mainwindow.cpp to this:#include "mainwindow.h" #include "ui_mainwindow.h" //#define SHA1 42 #include "Windows.h" #include "winnt.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); } MainWindow::~MainWindow() { delete ui; }
Now if you uncomment that #define on line 3 and compile with MSVC2017 you'll get the same error. So look for a similar flavored #define in your program.
-
Exactly that. I found the offending item and I can change it.
Thanks for your help.
Brian
-
Perfect! So it was in your code?
And please mark this thread as SOLVED so others know a solution was found. Thanks!
-
Yes it was in an 'external' part of my code but I have the source and can change it.
Thanks again for your support.