I was trying to execute a DLL function that has __stdcall
calling convention using QtConcurrent::run()
, but I am getting compile errors.
I've reduced the problem to this example code:
__stdcall void dllFunc() {
qDebug() << "test";
}
void test() {
QtConcurrent::run(dllFunc);
}
If I remove __stdcall
the code compiles and runs fine. Otherwise I get these compile errors:
error: invalid conversion from 'void (*)()' to 'void (*)()'
error: initializing argument 1 of 'QFuture<T> QtConcurrent::run(T (*)()) [with T = void]'
Why is this happening, and what is the best workaround?