How to properly install pthreads on Visual C++ 2010?

Hey.
I recently got into multithreading and I wanted to make sure that I got my pthreads installed correctly on my Visual C++ 2010.

Basically I did this:

I downloaded the three header files from here:
ftp://sourceware.org/pub/pthreads-win32/dll-latest/include/

and placed them in my includes folder in visual C++. I can now see them when I try to include them with angle brackets.
Then, I downloaded the lib files from here:
ftp://sourceware.org/pub/pthreads-win32/dll-latest/lib/x86/

and placed them in the lib folder.
And then, I downloaded the dll files from here:
ftp://sourceware.org/pub/pthreads-win32/dll-latest/dll/x86/

and placed them in my C:/Windows folder.
I went went to project properties, and added "pthreadVC2.lib" to the linker.

I run a x64 system, but I tried using the 64 libs and dlls and it didn't work.

I can now use the pthreads API, and it does compile but I do get some weird linker warnings like these:

1>threads.obj : warning LNK4248: unresolved typeref token (0100001F) for 'pthread_attr_t_'; image may not run
1>threads.obj : warning LNK4248: unresolved typeref token (01000020) for 'pthread_mutex_t_'; image may not run

It does run, but post these warnings which I, as a beginner, don't really get hehe.

I'm only starting to get into multithreading, and so I want to make sure that I did everything correct in terms of adding pthreads because as a beginner, having to deal with all kinds of errors can be pretty frustrating.

Thanks in advance.
closed account (S6k9GNh0)
Don't use pthreads... use something like std::threads. pthreads is tailored towards POSIX (which Cygwin contains an implementation of as a result) but it's still not that great to use directly.
Last edited on
Topic archived. No new replies allowed.