linux tinyxml²åÈë½Úµã
bool InstertNode(string& szFileName)
{
TiXmlDocument myDocument(szFileName);
bool loadOkay = myDocument.LoadFile();
if(loadOkay == false)
return false;
//»ñµÃ¸ùÔªËØ
TiXmlElement *rootElement = myDocument.RootElement();
if(rootElement == NULL)
return false;
//´´½¨Ò»¸öPersonÔªËØ²¢Á¬½Ó¡£
TiXmlElement *PersonElement = new TiXmlElement("Person");
rootElement->LinkEndChild(PersonElement);
//ÉèÖÃPersonÔªËØµÄÊôÐÔ¡£
PersonElement->SetAttribute("ID", "3");
//´´½¨nameÔªËØ¡¢ageÔªËØ²¢Á¬½Ó¡£
TiXmlElement *NameElement = new TiXmlElement("name");
TiXmlElement *AgeElement = new TiXmlElement("age");
PersonElement->LinkEndChild(NameElement);
PersonElement->LinkEndChild(AgeElement);
//ÉèÖÃnameÔªËØºÍageÔªËØµÄÄÚÈݲ¢Á¬½Ó¡£
TiXmlText *NameContent = new TiXmlText("ÕÔÁÁÁÁ");
TiXmlText *AgeContent = new TiXmlText("30");
NameElement->LinkEndChild(NameContent);
AgeElement->LinkEndChild(AgeContent);
//±£´æ
myDocument.SaveFile(szFileName);
return true;
}
ÔÚÊ÷µÄĩβ²åÈëеĽڵã/ÔªËØ
Ïà¹ØÎĵµ£º
¹¹½¨»ù±¾µÄǶÈëʽLinux¸ùÎļþϵͳ
¹¹½¨»ù±¾µÄǶÈëʽLinux¸ùÎļþϵͳ
£¨1£©´´½¨¸ùÎļþϵͳµÄ»ù±¾Ä¿Â¼½á¹¹¡£
ÎÒ°ÑÕâ¸ö¹ý³Ì×ö³ÉÁËshell½Å±¾(ÎļþÃûΪmkroot) £¬ºÜ·½±ã£¡
#! /bin/sh
echo "creatint rootfs dir......"
mkdir rootfs
&n ......
Linuxϵͳ²é¿´·þÎñÆ÷ʱ¼äºÜ¼òµ¥ÊäÈë"date"ÃüÁî¾Í¿ÉÒÔ.µ«ÊÇÓÐʱ·¢ÏֺܶàµÄ·þÎñÆ÷µÄµ±Ç°Ê±¼ä¶¼²»×¼È·,²»ÊÇÂý¾ÍÊÇ¿ìÁË,ÓеϹÏà²îÒ»¸öСʱ¡£ËäȻʱ¼ä²»×¼È·²»»áÓ°Ïì·þÎñÆ÷¹¤×÷£¬µ«ÊÇÎÒÃǼÈë×ÊÁÏ¡¢µÇ¼ÇһЩ¶«Î÷µÄʱ¼ä¶¼»á²»×¼È·¡£
¡¡¡¡ÒªÊÇ·¢ÏÖÎÒÃǵÄÓ¦ÓúÍÊý¾Ý¿â·þÎñÆ÷ϵͳʱ¼ä²»¶Ô¿ÉÒÔʹÓÃÕ⼸¸öÃüÁîÐ޸ģº
¡¡¡¡1¡¢ÏÈÉèÖÃÈ ......
³ÉΪһÃû¾«Í¨ Linux ³ÌÐòÉè¼ÆµÄ¸ß¼¶³ÌÐòÔ±Ò»Ö±ÊDz»ÉÙÅóÓÑ×Î×ÎÒÔÇóµÄÄ¿±ê¡£¸ù¾ÝÖлªÓ¢²ÅÍøÍ³¼ÆÊý¾Ý£¬±±¾©µØÇø Linux ³ÌÐòÔ±ÔÂнƽ¾ùΪ Windows ³ÌÐòÔ±µÄ 1.8 ±¶¡¢Java ³ÌÐòÔ±µÄ 2.6 ±¶£¬ Linux ³ÌÐòÔ±ÄêÖÕ½±½ðƽ¾ùΪ Windows ³ÌÐòÔ±µÄ 2.9 ±¶¡£Í¬Ê±Êý¾ÝÏÔʾ£¬Ëæ×ʤ×÷¾ÑéµÄÔö³¤£¬ Linux ³ÌÐòÔ±Óë Windows ³ÌÐòÔ±µÄÊÕÈë²î¾à» ......
ÎÊÌ⣺
gcc -c main.c -L ./include libmmgr.a
µÄʱºò£¬×ÜÊDZ¨´í£¬
ÕýÈ·µÄ×ö·¨ÊÇ
gcc -c main.c -L ./include -lmmgr
ÓÐÒ»¸öÎóÇøÊÇ£¬
gcc -c main.c -L. libmmgr.a
ÓÐʱºòÒ²ÊǶԵ쬵«ÕâÊÇÌØÀý£¬ÊÇmain.cºÍlibmmgr.aÔÚͬһ¸ö·¾¶Ï£¬ÕâʱµÄ-L.²»Æð×÷Ó㬼´Ê¹É¾³ýÒ²¿ÉÒÔ¡£ ......
1. Linux ½Å±¾±àд»ù´¡
1.1 Óï·¨»ù±¾½éÉÜ
1.1.1 ¿ªÍ·
³ÌÐò±ØÐëÒÔÏÂÃæµÄÐпªÊ¼£¨±ØÐë·½ÔÚÎļþµÄµÚÒ»ÐУ©£º
#!/bin/sh
¡¡¡¡·ûºÅ#!ÓÃÀ´¸æËßϵͳËüºóÃæµÄ²ÎÊýÊÇÓÃÀ´Ö´ÐиÃÎļþµÄ³ÌÐò¡£ÔÚÕâ¸öÀý×ÓÖÐÎÒÃÇʹÓÃ/bin/shÀ´Ö´ÐгÌÐò¡£
¡¡¡¡µ±±à¼ºÃ½Å±¾Ê±£¬Èç¹ûÒªÖ´Ðиýű¾£¬»¹±ØÐëʹÆä¿ÉÖ´ÐС£
¡¡¡¡ÒªÊ¹½Å±¾¿ÉÖ´ÐУº
±àÒë ......