TurboActivate interfering with qdatetime.h

I am trying to call IsGenuineEx at specific intervals in my program, however I get syntax errors upon compiling:

C:\Qt\Qt5.0.2\5.0.2\msvc2010\include\QtCore\qdatetime.h:123: warning: C4003: not enough actual parameters for macro 'min'C:\Qt\Qt5.0.2\5.0.2\msvc2010\include\QtCore\qdatetime.h:123: error: C2589: '(' : illegal token on right side of '::'C:\Qt\Qt5.0.2\5.0.2\msvc2010\include\QtCore\qdatetime.h:123: error: C2059: syntax error : '::'

This only occurs when I have the TurboActivate header included. After some research, it apparently happens because 'min' is used in both TurboActivate and qdatetime (min = minutes).

How do I correct this? I'm developing my program with Qt 5.0.2

Thanks for your time.

TurboActivate.h doesn't use or define "min". This problem you're having has nothing to do with TurboActivate.

If you're using the static version of TurboActivate and that's causing the problem then either (a) use the dynamic version of TurboActivate or (b) fix whatever bug is in the QT library or (c) don't use the static version of the QT library.

I just commented out the inclusion of TurboActivate and the IsGenuineEx function calls and it compiles perfectly.

As soon as I un-comment #include "TurboActivate.h" I get the error.

Also, everything is dynamic.

There's a problem somewhere in your code or you modified the TurboActivate.h file. Or both. Include an unmodified version of TurboActivate.h in your app. Recompile. It should work fine.

If you provide more information (starting with code showing how you're using TurboActivate) we'll be able to help you.

I did not modify the header file.

Periodically, I called the function as shown in the tutorial:

GENUINE_OPTIONS opts; opts.nLength = sizeof(GENUINE_OPTIONS); opts.nDaysBetweenChecks = 30; opts.nGraceDaysOnInetErr = 14;

opts.flags = TA_SKIP_OFFLINE;

HRESULT hr = IsGenuineEx(L"3f53034554c5873609e5d6.27574134", &opts);

if (hr == TA_OK || hr == TA_E_FEATURES_CHANGED || hr == TA_E_INET || hr == TA_E_INET_DELAYED) { // your app is activated and genuine

if (hr == TA_E_INET || hr == TA_E_INET_DELAYED) { // TODO: show a warning to your user that this time (or recently) // the IsGenuineEx() failed to connect to the LimeLM servers. } } else { QMessageBox::warning(this, "Piracy Detected!", "Your copy of MC360 NBT Editor is illegitimate. By pirating this software you have illegally broken license terms. This software will no longer function properly!"); // TODO: Not genuine or not activated. Either way you should either // restrict the user from using your app or give the user a trial // of your app. }

The error only occurs in .cpp files that also include <QtCore> which has qdatetime.h in it. TurboActivate is in some way messing with qdatetime.h

I just created a barebones program and I have confirmed that the inclusion of both QtCore and TurboActivate.h at the same time causes the errors I am getting.

I have already seen this. I have not included windows.h in my project. And defining NOMINMAX doesn't solve the issue.

This is my full include list:

#include "mainwindow.h"#include "ui_mainwindow.h"#include "MyQFileSystemModel.h"#include "tagedit.h"#include "arrayedit.h"#include "chunkloader.h"#include "about.h"#include "TurboActivate.h"#include <QtCore>#include <QFileDialog>#include <QMessageBox>#include <QFileSystemModel>#include <QComboBox>#include <QStandardItemModel>#include <sstream>#include <QClipboard>#include <QDesktopServices>#include <QNetworkAccessManager>#include <QNetworkRequest>#include <QNetworkReply>#include <QEventLoop>#ifdef _WIN32 #pragma comment (lib, "TurboActivate.lib")#endif

Could the problem possibly be because TurboActivate uses windows.h? I'm not sure if it does, but that would make sense.

I have fixed the problem by modifying TurboActivate.h. I found the inclusion of windows.h and defined NOMINMAX above it.