易截截图软件、单文件、免安装、纯绿色、仅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环境下gethostbyname函数问题 - C/C++ / C语言

写了个测试程序如下
   
  struct hostent *hp; 
char AlarmDevIP[20];  
  int x2;

hp = gethostbyname("www.google.com");
if (hp)
{ ......

是选win2008还是suse linux、redhat、centos,犹豫中

引用内容vsking 2009-12-25 22:56:52
现在是win2008和iis8的时代了,不要还停留在iis5时代,win2008被评为十佳操作系统之首不是偶然的,你要是..
我的问题是:
最近想买个服务器,看了dell上的系统定制选择,一些 ......

linux 定时重启服务,在线等 - PHP / 基础编程

我的项目所在的环境是php+apache+linux
现我重启服务是 service httpd restart 
现我想定时重启此项服务(定在每天下午4点) 怎么实现呀,多谢
crontab
* 16 * * * service httpd restart

学习 + d ......

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

在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号