如何在Windows上运行pthread [英] How to run pthreads on windows
问题描述
我曾经使用Mac编写一些c程序,但现在无法正常工作..我不得不使用一台旧的Windows笔记本电脑一段时间..
I used to use a mac to write some c programs but its not working now.. I have to use an old windows laptop for a while..
我安装了代码块,并使用pthreads测试了一个简单程序.不幸的是,它没有用..
I installed codeblocks and tested a simple program using pthreads. Unfortunately it didnt work..
pthread_create(&thrd1, NULL, thread_execute, (void *)t);
它一直在说对' imp _pthread_create'
It keeps saying undefined reference to 'imp_pthread_create'
我该如何解决它,编写此类程序会遇到类似的问题吗?
how can i fix it and will i face similar problems writing these sort of programs?
谢谢
推荐答案
您显然已经获得Windows的pthread版本.您只是没有在链接器设置中包括.lib文件.做到这一点,你应该是金色的.
You've clearly got a version of pthreads for Windows. You just haven't included the .lib file in your linker settings. Do that and you should be golden.
这篇关于如何在Windows上运行pthread的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!