Error while linking with user32 library
-
it always tell winnt.h:169: error: C1189: #error: "No Target Architecture" when i tried to either use pragma or
```
QFunctionPointer p;
QLibrary *lib = new QLibrary("user32");
if(lib->load() && (p = lib->resolve("SetWindowDisplayAffinity"))) {
qDebug() << "Lib loaded";
} else {
qDebug() << "Lib could not load";
}can someone help me with this please
-
it always tell winnt.h:169: error: C1189: #error: "No Target Architecture" when i tried to either use pragma or
```
QFunctionPointer p;
QLibrary *lib = new QLibrary("user32");
if(lib->load() && (p = lib->resolve("SetWindowDisplayAffinity"))) {
qDebug() << "Lib loaded";
} else {
qDebug() << "Lib could not load";
}can someone help me with this please
@peteradde
And what is the code inwinnt.h
around line #169 which leads to this...? -
@peteradde
So it looks to me as though you need to have defined an "architecture" symbol (perhaps_X86_
?) so that line #159 leads to line #160.And I don't know where this file is included into your code from, since you mention nothing about
#include
s, or whether it's supposed to be included or whether it's not supposed to reach that line. -
Your piece of code and the error message have nothing in common. Please provide a minimal compileable example to reproduce your issue.