易截截图软件、单文件、免安装、纯绿色、仅160KB

linux多线程编成 - Linux/Unix社区 / 程序开发区

#include<stdio.h>
#include<stdlib.h>
#include<pthread.h>

void *first()
{
printf("first pthread-----ABC\n");
}

void *second()
{
printf("second pthread-----ABC\n");
}

int main()
{
printf("mian pthread----ABC\n");
pthread_t fthread;
pthread_t sthread;

pthread_create(&fthread,NULL,first,NULL);
pthread_create(&sthread,NULL,second,NULL);

pthread_join(fthread,NULL);
pthread_join(sthread,NULL);
return 0;
}

我编译提示错误如下
fily@zhaoyf:/media/work/develop/iscsitarget/usr$ gcc -o thread thread.c
/tmp/ccRbUIwW.o: In function `main':
thread.c:(.text+0x4e): undefined reference to `pthread_create'
thread.c:(.text+0x66): undefined reference to `pthread_create'
thread.c:(.text+0x74): undefined reference to `pthread_join'
thread.c:(.text+0x82): undefined reference to `pthread_join'
collect2: ld returned 1 exit status

高手帮忙,我错在哪里了?
我使用的是debian5linux{{


相关问答:

教育网更新Linux软件 - Linux/Unix社区 / 程序开发区

大家好:
  我的电脑练的是教育网,上不了外国的网站,在用Linux更新软件,例如apt-get或是yum的时候连不到服务器。不知道大家有没有过这种情况啊,是如何解决的啊,谢了!
可以找一下,edu的更新源。比如 ......

linux shutdown - Linux/Unix社区 / UNIX文化

大家好,我现在正在学习linux系统,碰到点问题想请问大家,希望前辈能够指教。
在linux中为什么我用shutdown -r now 命令来重启系统没有用呢,而reboot命令就可以。
另外我也试过#shutdown -r now 和
shutdow等命 ......

QT linux open - 移动平台 / Qt开发

请问各位,我现在需要在QT下调用linux下的open函数,请问各位大侠怎么写呀?
因为我需要open函数返回的fd指针
include 相应的头文件,QLibrary加载相应的库,或者静态连接进去。
然后typdef定义函数类型,然后inv ......

linux 权限设置的问题 - Web 开发 / 应用服务器

在ubuntu上搭建了服务器,根目录为/var/www,使用php脚本在/var/www/html文件夹下生成了文件夹和文件,生成的格式是/var/www/html/123456/sss.html,生成后查看html文件夹的权限是www-data,我执行php的删除脚本的时 ......

linux 权限设置的问题 - Web 开发 / Apache

在ubuntu上搭建了服务器,根目录为/var/www,使用php脚本在/var/www/html文件夹下生成了文件夹和文件,生成的格式是/var/www/html/123456/sss.html,生成后查看html文件夹的权限是www-data,我执行php的删除脚本的时 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号