Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÔÚlinuxÏÂʹÓÃCMake¹¹½¨Ó¦ÓóÌÐò

ÔÚlinuxÏÂʹÓÃCMake¹¹½¨Ó¦ÓóÌÐò
c/c++ 2010-04-11 17:07:29 ÔĶÁ5 ÆÀÂÛ0 ×ֺţº´óÖÐС
±¾ÎĽéÉÜÁËÒ»¸ö¿çƽ̨µÄ×Ô¶¯»¯¹¹½¨ÏµÍ³ CMake ÔÚ linux ÉϵÄʹÓ÷½·¨¡£ CMake ÊÇÒ»¸ö±È automake ¸ü¼ÓÈÝÒ×ʹÓõŤ¾ß£¬Äܹ»Ê¹³ÌÐòÔ±´Ó¸´ÔӵıàÒëÁ¬½Ó¹ý³ÌÖнâÍѳöÀ´¡£ÎÄÖÐͨ¹ýһЩÀý×Ó½éÉÜʹÓà CMake ´¦Àí¶àÔ´ÎļþĿ¼µÄ·½·¨¡¢²éÕÒ²¢Ê¹ÓÃÆäËû¿ª·¢°üµÄ·½·¨ÒÔ¼°Éú³É debug °æºÍ release °æ³ÌÐòµÄ·½·¨¡£
CMake ¼ò½é
    CMake ÊÇÒ»¸ö¿çƽ̨µÄ×Ô¶¯»¯½¨¹¹ÏµÍ³,ËüʹÓÃÒ»¸öÃûΪ CMakeLists.txt µÄÎļþÀ´ÃèÊö¹¹½¨¹ý³Ì,¿ÉÒÔ²úÉú±ê×¼µÄ¹¹½¨Îļþ,Èç Unix µÄ Makefile »òWindows Visual C++ µÄ projects/workspaces ¡£Îļþ CMakeLists.txt ÐèÒªÊÖ¹¤±àд,Ò²¿ÉÒÔͨ¹ý±àд½Å±¾½øÐаë×Ô¶¯µÄÉú³É¡£CMake ÌṩÁË±È autoconfig ¸ü¼ò½àµÄÓï·¨¡£ÔÚ linux ƽ̨ÏÂʹÓà CMake Éú³É Makefile ²¢±àÒëµÄÁ÷³ÌÈçÏÂ:
    1.±àд CmakeLists.txt¡£
2.Ö´ÐÐÃüÁî “cmake PATH” »òÕß “ccmake PATH” Éú³É Makefile ( PATH ÊÇ CMakeLists.txt ËùÔÚµÄĿ¼ )¡£
3.ʹÓà make ÃüÁî½øÐбàÒë¡£
    µÚÒ»¸ö¹¤³Ì
    ÏÖ¼ÙÉèÎÒÃǵÄÏîÄ¿ÖÐÖ»ÓÐÒ»¸öÔ´Îļþ main.cpp
    Çåµ¥ 1 Ô´Îļþ main.cpp
  
#include<iostream>
int main()
{
std::cout<<"Hello word!"<<std::endl;
return 0;
}
    ΪÁ˹¹½¨¸ÃÏîÄ¿,ÎÒÃÇÐèÒª±àдÎļþ CMakeLists.txt ²¢½«ÆäÓë main.cpp ·ÅÔÚ Í¬Ò»¸öĿ¼ÏÂ:
    Çåµ¥ 2 CMakeLists.txt
  
1 PROJECT(main)
2 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
3 AUX_SOURCE_DIRECTORY(. DIR_SRCS)
4 ADD_EXECUTABLE(main ${DIR_SRCS})
    CMakeLists.txt µÄÓï·¨±È½Ï¼òµ¥,ÓÉÃüÁî¡¢×¢ÊͺͿոñ×é³É,ÆäÖÐÃüÁîÊDz»Çø·Ö´óСдµÄ,·ûºÅ"#"ºóÃæµÄÄÚÈݱ»ÈÏΪÊÇ×¢ÊÍ¡£ÃüÁîÓÉÃüÁîÃû³Æ¡¢Ð¡À¨ºÅºÍ²ÎÊý×é³É,²ÎÊýÖ®¼äʹ Óÿոñ½øÐмä¸ô¡£ÀýÈç¶ÔÓÚÇåµ¥2µÄ CMakeLists.txt Îļþ:µÚÒ»ÐÐÊÇÒ»ÌõÃüÁî,Ãû³ÆÊÇ PROJECT ,²ÎÊýÊÇ main ,¸ÃÃüÁî±íʾÏîÄ¿µÄÃû³ÆÊÇ main ¡£µÚ¶þÐеÄÃüÁîÏÞ¶¨ÁË CMake µÄ°æ±¾¡£µÚÈýÐÐʹÓÃÃüÁî AUX_SOURCE_DIRECTORY ½«µ±Ç°Ä¿Â¼ÖеÄÔ´ÎļþÃû³Æ¸³Öµ¸ø±äÁ¿ DIR_SRCS ¡£ CMake ÊÖ²áÖжÔÃüÁî AUX_SOURCE_DIRECTORY µÄÃèÊöÈçÏÂ:
aux_source_directory(<dir> <variabl


Ïà¹ØÎĵµ£º

Linux iptableÎĵµ

×ÜÀÀ
ÓÃiptables -ADC À´Ö¸¶¨Á´µÄ¹æ
Ôò
£¬-AÌí¼Ó -Dɾ³ý -C ÐÞ¸Ä
iptables - [RI] chain rule num rule-specification[option]
ÓÃiptables - RI ͨ¹ý¹æÔòµÄ˳ÐòÖ¸¶¨
iptables -D chain rule num[option]
ɾ³ýÖ¸¶¨¹æÔò
iptables -[LFZ] [chain][option]
ÓÃiptables -LFZ Á´Ãû [Ñ¡Ïî]
iptables -[NX] chain
ÓÃ -NX ......

linuxϵͳµ÷ÓÃÁбí

Ò»¡¢½ø³Ì¿ØÖÆ£º
fork
´´½¨Ò»¸öнø³Ì
clone
°´Ö¸¶¨Ìõ¼þ´´½¨×Ó
½ø³Ì
execve
ÔËÐпÉÖ´ÐÐÎļþ
exit
ÖÐ
Ö¹½ø³Ì
_exit
Á¢¼´ÖÐÖ¹µ±Ç°½ø³Ì
getdtablesize
½ø
³ÌËùÄÜ´ò¿ªµÄ×î´óÎļþÊý
getpgid
»ñȡָ¶¨½ø³Ì×é±êʶºÅ
setpgid
Éè
ÖÃÖ¸¶¨½ø³Ì×é±êÖ¾ºÅ
getpgrp
»ñÈ¡µ±Ç°½ø³Ì×é±êʶºÅ
setpgrp
Éè
Öõ±Ç°½ø³Ì×é± ......

linuxÖÐselect()º¯Êý·ÖÎö

select()µÄ»úÖÆÖÐÌṩһfd_setµÄÊý¾Ý½á¹¹£¬Êµ¼ÊÉÏÊÇÒ»longÀàÐ͵ÄÊý×飬 Ã¿Ò»¸öÊý×éÔªËØ¶¼ÄÜÓëÒ»´ò¿ªµÄÎļþ¾ä±ú£¨²»¹ÜÊÇSocket¾ä±ú,»¹ÊÇÆäËû Îļþ»òÃüÃû¹ÜµÀ»òÉ豸¾ä±ú£©½¨Á¢ÁªÏµ£¬½¨Á¢ÁªÏµµÄ¹¤×÷ÓɳÌÐòÔ±Íê³É£¬ µ±µ÷ÓÃselect()ʱ£¬ÓÉÄں˸ù¾ÝIO״̬ÐÞ¸Äfd_setµÄÄÚÈÝ£¬ÓÉ´ËÀ´Í¨ÖªÖ´ ÐÐÁËselect()µÄ½ø³ÌÄ ......

¹ØÓÚLinuxµÄÊé¼®

Linux²¢²»ÊÇÒ»¸ö±Èwindows¸üÉñÃØµÄϵͳ.
ÊǵÄLinuxûÓÐMSDN,µ«LinuxºÍÏà¹ØÈí¼þµÄÎĵµ¾ø¶Ô²»±ÈMSDNÒªÉÙ
¼ÇµÃ,Ò»¸ö¿´¹Ù·½ÍøÕ¾µÄÎĵµ,Ò»¸ögoogle.ÎÒÏë,´ó¶àÎÊÌâ¶¼»á½â¾öµÄ.ʣϵľͿ¿
Ä㶯ÊÖ½â¾öÁË.
linuxÈëÃÅ:
ûÓз¢ÏÖʲô±È½ÏºÃµÄÈëÃÅÊé,Ҫô̫¹ÅÀÏ,ҪôÕÕ¹ËÌ«¶àµÄ·ÅÐа汾,µ¼ÖÂûÓÐʲô
ʵ¼ÊÓô¦.ʵ¼ÊÉÏ,²Î¿¼·¢ÐÐ°æµ ......

Linux ÄÚºËÖÐµÄ GCC ÌØÐÔ(ת)

M. Tim Jones, ¹ËÎʹ¤³Ìʦ, Emulex Corp.
2009 Äê 4 ÔÂ 07 ÈÕ
Linux® ÄÚºËʹÓà GNU Compiler Collection (GCC) Ì×¼þµÄ¼¸¸öÌØÊ⹦ÄÜ¡£ÕâЩ¹¦ÄܰüÀ¨Ìṩ¿ì½Ý·½Ê½ºÍ¼ò»¯ÒÔ¼°Ïò±àÒëÆ÷ÌṩÓÅ»¯ÌáʾµÈµÈ¡£Á˽âÕâÐ©ÌØÊâµÄ GCC ÌØÐÔ£¬Ñ§Ï°ÈçºÎÔÚ Linux ÄÚºËÖÐʹÓÃËüÃÇ¡£
GCC ºÍ Linux ÊdzöÉ«µÄ×éºÏ¡£¾¡¹ÜËüÃÇÊǶÀÁ¢µÄÈí¼þ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ