ÔÚ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 Á¼ºÃµÄÓû§È¨ÏÞ¹ÜÀíÌåϵ£¬²¡¶¾ÍùÍùÊÇ Linux ϵͳ¹ÜÀíÔ±×îºó²ÅÐèÒª¿¼ÂǵÄÎÊÌâ¡£ÒÔÍù£¬Linux ÉϵÄɱ¶¾Èí¼þÖ÷ÒªÊÇΪÆóÒµµÄÓʼþºÍÎļþ·þÎñÆ÷ËùÉè¼ÆµÄ¡£Èç½ñ£¬Ëæ×Å Linux ×ÀÃæÓû§ÊýÁ¿µÄÔö³¤£¬×ÀÃæÓû§ÔÚÊÜÒæÓÚ Linux ϵͳ¶Ô²¡¶¾½ÏÇ¿µÄÌìÈ»ÃâÒßÁ¦µÄͬʱ£¬Ò²ÐèҪɱ¶¾Èí¼þÇåÀí´ÓÍøÂç»òUÅÌ´øÀ´µÄWIndows²¡¶¾¡£¾¡¹ÜÄÇЩ ......
do_exit() Function
-----------------------------------------------------------------------
kernel/exit.c
707 NORET_TYPE void do_exit(long code)
708 {
709 struct task_struct *tsk = current;
710
711 if (unlikely(in_interrupt()))
712 panic("Aiee, killing interrupt handler!");
713 if ......
Ô´´ÎÄÕ£¬×ªÔØÇë×¢Ã÷³ö´¦£¬Ð»Ð»£¡
×÷ÕߣºÇåÁÖ£¬²©¿ÍÃû£º·É¿Õ¾²¶É
ÔÚwindowsÏÂ×ö¹ý·´»ã±àµÄÈË£¬¹À¼Æ¶¼ÈÏʶollydbgÕâÑùÈí¼þ¡£Ã»´í£¬ollydbgÊÇwindowÏÂ×öÆƽâÈí¼þºÍ·´»ã±àÈí¼þÈËÊ¿µÄÀûÆ÷¡£ÏÖÔÚ½éÉÜÒ»¸öºÍollydbgÒ»ÑùµÄÈí¼þ£¬µ«ËüÊÇÔÚlinuxÏÂÔËÐÐµÄ --- EDG¡£
Õâ¸öÈí¼þµÄ×÷Õß±¾À´ÊǸöÈí¼þ·´»ã±àÈËÊ¿£¬ÔÚwindowsϾ³£·´»ã±à ......
M. Tim Jones, ¹ËÎʹ¤³Ìʦ, Emulex Corp.
2009 Äê 4 ÔÂ 07 ÈÕ
Linux® ÄÚºËʹÓà GNU Compiler Collection (GCC) Ì×¼þµÄ¼¸¸öÌØÊ⹦ÄÜ¡£ÕâЩ¹¦ÄÜ°üÀ¨Ìṩ¿ì½Ý·½Ê½ºÍ¼ò»¯ÒÔ¼°Ïò±àÒëÆ÷ÌṩÓÅ»¯ÌáʾµÈµÈ¡£Á˽âÕâЩÌØÊâµÄ GCC ÌØÐÔ£¬Ñ§Ï°ÈçºÎÔÚ Linux ÄÚºËÖÐʹÓÃËüÃÇ¡£
GCC ºÍ Linux ÊdzöÉ«µÄ×éºÏ¡£¾¡¹ÜËüÃÇÊǶÀÁ¢µÄÈí¼þ ......
ÎÒÓõÄLinuxϵͳÊÇUbuntu 10.04
Ê×ÏÈ, °²×°wxWidgets 2.8. Ä¿Ç°wxWidgetsÓÐÁ½¸öÎȶ¨°æ±¾, 2.6ºÍ2.8, ÎÒÃÇÑ¡×îеÄ. ´ò¿ª “Ubuntu
Èí¼þÖÐÐÄ”, ÔÚËÑË÷¿òÀïÊäÈë “wxWidgets”, °ÑÏÂÃ漸¸öÃû×ÖÒÔ”wxWidgets Cross-platform C++ GUI
toolkit”¿ªÍ·µÄÈ«²¿°²×°. ×°Íêºó, ´ò¿ªÒ»¸öÖÕ¶Ë, ÊäÈ ......