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{{
Ïà¹ØÎÊ´ð£º
дÁ˸ö²âÊÔ³ÌÐòÈçÏÂ
struct hostent *hp;
char AlarmDevIP[20];
int x2;
hp = gethostbyname("www.google.com");
if (hp)
{
......
¾ßÌåְλҪÇó£º
1. ´óѧ±¾¿ÆÒÔÉÏѧÀú£¬¼ÆËã»úÏà¹Ø×¨Òµ±ÏÒµ£»
2. ÊìϤTCP/IPÐÒé¡¢SocketÍøÂç±à³Ì¡¢¶àÏ̱߳à³Ì£»
3. ¾«Í¨LinuxÏÂC/C++ÓïÑÔ±à³Ì¡¢GCC±àÒëÆ÷¡¢gdbµ÷ÊÔÆ÷µÄʹÓã¬ÊìϤMakefileºÍShell£»
4. Á˽âÈí¼þ¿ ......
ÎÒÊÇlinux 5¡£4 redhat°æ±¾ ×°²»ÉÏadobe ÇóÖú¸÷λ¸ßÊÖÖ¸µã
Ò»µãÐÅÏ¢¶¼²»¸ø ËÖªµÀÔõô»ØÊ°¡
¶àÉÏÍøËÑËÑ °²×°Ö®Ç°ÏÈ¿´¿´Èí¼þµÄÒªÇóÒÔ¼°READMEµÈ˵Ã÷
32λ°æµÄÊÇ¿ÉÒÔ×°µÄ£¬64λµÄ»¹² ......
ÇëÎʸ÷룬ÎÒÏÖÔÚÐèÒªÔÚQTϵ÷ÓÃlinuxϵÄopenº¯Êý£¬ÇëÎʸ÷λ´óÏÀÔõôдѽ£¿
ÒòΪÎÒÐèÒªopenº¯Êý·µ»ØµÄfdÖ¸Õë
include ÏàÓ¦µÄÍ·Îļþ£¬QLibrary¼ÓÔØÏàÓ¦µÄ¿â£¬»òÕß¾²Ì¬Á¬½Ó½øÈ¥¡£
È»ºótypdef¶¨Ò庯ÊýÀàÐÍ£¬È»ºóinv ......
ÔÚubuntuÉϴÁË·þÎñÆ÷£¬¸ùĿ¼Ϊ/var/www£¬Ê¹ÓÃphp½Å±¾ÔÚ/var/www/htmlÎļþ¼ÐÏÂÉú³ÉÁËÎļþ¼ÐºÍÎļþ£¬Éú³ÉµÄ¸ñʽÊÇ/var/www/html/123456/sss.html£¬Éú³Éºó²é¿´htmlÎļþ¼ÐµÄȨÏÞÊÇwww-data£¬ÎÒÖ´ÐÐphpµÄɾ³ý½Å±¾µÄʱ ......