Trying to use tcl threads on windows 7 results in access violation.

Posted by Juan on Stack Overflow See other posts from Stack Overflow or by Juan
Published on 2010-01-01T06:17:57Z Indexed on 2010/03/19 19:01 UTC
Read the original article Hit count: 170

Filed under:
|
|

I'm trying to get this simple program to work on windows, but it crashes:

unsigned (__stdcall testfoo)(ClientData x)
{
    return 0;
}

int main()
{
  Tcl_ThreadId testid = 0;
  Tcl_CreateThread(&testid, testfoo, (ClientData) NULL, TCL_THREAD_STACK_DEFAULT, TCL_THREAD_NOFLAGS);
}

I am using a makefile generated by cmake and linking against a version of Tcl 8.5.7 I compiled myself using Visual C++ 2008 express. It was compiled using msvcrt,static,threads and the name of the resulting library is tcl85tsx.lib. The error is:

Unhandled exception at 0x77448c39 in main.exe: 0xC0000005: Access violation writing location 0x00000014.

The Tcl library works fine, and I can even run a threading script example by loading the Thread extension into it. My assumption is that there is something horribly wrong with a memory violation, but I have no idea what. Any help appreciated.

© Stack Overflow or respective owner

Related posts about tcl

Related posts about windows-7