this is the test code
#include \"windows.h\" #include \"iostream\" using namespace std; __declspec(thread) int tls_int = 0; void NTAPI tls_callback(PVOID,
You also must explicitly add the symbol __tls_used. With this your code should work:
#pragma comment(linker,"/include:__tls_used")