當我嘗試執行簡單的tinylibxml程序時出現錯誤。鏈接問題tinylibxml C++ Ubuntu
OS - > Ubuntu的 IDE - 通過>電子 我有下載libtinyxml易於得到安裝 並列入我的計劃 的頭,但我仍然得到錯誤 示例代碼粘貼下面
#include "tinyxml.h"
#define TIXML_USE_STL
#include <tinyxml.h>
void dump_to_stdout(const char* pFilename);
int main()
{
dump_to_stdout("example1.xml");
return 0;
}
void dump_to_stdout(const char* pFilename)
{
TiXmlDocument doc(pFilename);
bool loadOkay = doc.LoadFile();
if (loadOkay)
{
printf("\n%s:\b", pFilename);
}
else
{
printf("Failed to load file \"%s\"\n", pFilename);
}
}
由於我沒有使用Google,我發現我需要包含libtinyxml.cpp和其他一些文件。 請問你們,請指導我如何做到這一點。
感謝
如果添加錯誤消息,以及這將是有益的。添加代碼時,請使用下面的格式代碼按鈕。它確實使它更具可讀性。 – doron 2010-12-03 14:38:38
你正在得到什麼錯誤? – misha 2010-12-03 14:39:08