Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

pthreads

Hi group.

I'm a recent graduate in CS and have done all my past programming in C++ on
a Solaris machine. However, I recently installed Visual C++. In an effort
to get accustomed to it I tried bringing over some of my old UNIX code to
get it to work on the Windows machine. The problem that I had was that
pthreads were not implemented. However, I downloaded the package that is
supposed to have everything needed to implement the pthread class.

My question is where do I put the files in order to be able to get things
going smoothly? I put the .h files into the Include folder, which is where
I assume those go. I put the .lib file in the Lib folder. I put the .dll
file in the directory c:\WINNT (Win2kPro). To me these locations for the
files made sense. Is
there something I'm obviously not doing right? The
reason I ask is because my program compiles cleanly, however, when I try to
create the .exe it fails in linking with the following error messages:

Linking...
3Thread.obj : error LNK2001: unresolved external symbol __imp__pthread_join
3Thread.obj : error LNK2001: unresolved external symbol
__imp__pthread_create
Debug/3Thread.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

Since my program works fine in UNIX and compiles cleanly in Visual C++ I'm
lead to believe that I did something wrong with the placement of the above
mentioned files. Anyone out there gotten pthreads running fine on their
systems? Or is it my code that is wrong? Thanks for any help that anyone
could provide!

Brian
0 Kudos
Message 1 of 3
(4,250 Views)
Hi, Brian.
I met same problem when my compiller found other files with same name in another folder...
Where did U put headers? I recomend use setting in VC++
Options->Directories, move folder with .h and lib at top.

And another variant. Did U connect(link) lib in your project?

Hope that it help U 🙂
0 Kudos
Message 2 of 3
(4,250 Views)
"Spivot" wrote in message
news:5065000000050000007AA30000-1031838699000@exchange.ni.com...
> Hi, Brian.
> I met same problem when my compiller found other files with same
> name in another folder...
> Where did U put headers? I recomend use setting in VC++
> Options->Directories, move folder with .h and lib at top.
>
> And another variant. Did U connect(link) lib in your project?
>
> Hope that it help U 🙂

Thanks for the suggestions. I didn't link the library to my project. I
didn't realize that I had to do that, like I said new to Visual C++ 🙂
Thanks a ton though, it worked and I got the program running with standard
style posix threads 🙂 I guess it would've made too much sense for MS to
include these originally
...
0 Kudos
Message 3 of 3
(4,250 Views)