And if you want threads to work, initialize the thread local variable in YPinit_world: #elif defined(MSVC_THREAD) tregs = TlsAlloc(); goo_thread = TlsAlloc(); msc_calln_regs = TlsAlloc(); #endif Chris.