When I try to build the following code using MinGW in Eclipse, I get the error "Function 'CreateThreadpool' could not be resolved"
The code:
#define WINVER 0x0603
#define _WIN32_WINNT 0x603
#include <threadpoolapiset.h>
int main(void)
{
CreateThreadpool(nullptr);
return 0;
}
Note: If I remove the defines for windows version, then I get 2 errors:
1. 'CreateThreadpool' was not declared in this scope
2. Function 'CreateThreadpool' could not be resolved
This means that the defines are making posible for threadpoolapiset.h header to declare the windows API functions.
So back to the initial example, the problem here is that the linker can't find the library where this function is defined.
According to MSDN this function is defined in library kernel32.lib and DLL kernel32.dll.
I found that in MinGW directories the kernel32 library is found as libkernel32.a, so I tryed including paths and libraries in C/C++ Build > Settings | Tab 'Tool Settings' > GCC C++ Compiler > Includes
I tryed including the directory, the library file and both. Also I did this in MinGW C++ Linker > Libraries
Does any one know how can I make it work?