Linking problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Linking problem

Mats Aubell
Hi all,

I'm having problems getting the pthread library to work. I've followed the
instructions which can be found in the faq
( I have the dll file in the
Windows catalog. The 3 headers files are in the same folder and the lib file
has been added through the tools->options->projects->vc++ directories. When
I compile I get this error msg:

ssds error LNK2019: unresolved external symbol __imp__pthread_create
referenced in function _main

The relevant source code can be seen under.

#include "pthread.h"

void * threadBehavior(void * arg)
        return 0;

pthread_t m_threadBehavior;

int main(int argc, char *argv[])
if (pthread_create(&m_threadBehavior, NULL, threadBehavior, NULL))
    printf("Cannot create the behavior thread.\n");  
    return false;
return 0;

I'm running WinXP and Microsoft Visual Studio 2003. Getting quite desperate
for help, so any feedback is greatly appreciated.

Mats Aubell