国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 編程設計 > 正文

使用vs2010編譯log4cxx圖文教程

2020-06-27 15:15:03
字體:
來源:轉載
供稿:網(wǎng)友

本文一共包含了17個步驟,按照下面的步驟就可以完成vs2010中編譯log4cxx的工作了。

1. 下載 log4cxx 以及 apr 和 apr-util源碼:

a)http://www.apache.org/dyn/closer.cgi/logging/log4cxx/0.10.0/apache-log4cxx-0.10.0.zip

b)http://archive.apache.org/dist/apr/apr-1.2.11-win32-src.zip

c)http://archive.apache.org/dist/apr/apr-util-1.2.10-win32-src.zip

vs2010,編譯,log4cxx,圖文教程
 

2. 將 3個壓縮包解壓到同一個目錄.如下圖:

 

vs2010,編譯,log4cxx,圖文教程
 

3. 將 apr-1.2.11重命名為 apr, 將 apr-util-1.2.10 重命名為apr-util.如下圖:

vs2010,編譯,log4cxx,圖文教程
 

4、打開cmd窗口,如下圖所示:

vs2010,編譯,log4cxx,圖文教程
 

5、在4中輸入:cdD:/log4cxx_compile/apache-log4cxx-0.10.0 回車

然后輸入:d: 回車后 切換至 apache-log4cxx-0.10.0目錄

vs2010,編譯,log4cxx,圖文教程
 

6、在5中輸入:configure.bat回車

vs2010,編譯,log4cxx,圖文教程
 

7.在6的基礎下dos窗口下繼續(xù)輸入:configure-aprutil.bat回車

vs2010,編譯,log4cxx,圖文教程
 

8、進入D:/log4cxx_compile/apr-util/include中并找到apu.hw文件,如下圖:vs2010,編譯,log4cxx,圖文教程


9、用Notepad++打開apu.hw文件(記事本也可以)vs2010,編譯,log4cxx,圖文教程

手動修改 apr-util/include/apu.hw里的內容

#define APU_HAVE_APR_ICONV1

改為

#define APU_HAVE_APR_ICONV0

vs2010,編譯,log4cxx,圖文教程
10. 使用VS2010打開 apache-log4cxx-0.10.0/projects 下的 log4cxx.dsw

vs2010,編譯,log4cxx,圖文教程
 

 

打開工程會提示轉換:

vs2010,編譯,log4cxx,圖文教程
 

 

11、轉換好后工程如下圖:

vs2010,編譯,log4cxx,圖文教程
 

 

12、將 log4cxx設置為啟動項.

設置前:

vs2010,編譯,log4cxx,圖文教程
 

 

設置后:

vs2010,編譯,log4cxx,圖文教程
 

13.開始編譯.log4cxx

 

 

 

 

vs2010,編譯,log4cxx,圖文教程

出現(xiàn)

 

4>D:/log4cxx_compile/apache-log4cxx-0.10.0/src/main/include/log4cxx/spi/loggingevent.h(155):error C2252: 只能在命名空間范圍內顯式實例化模板vs2010,編譯,log4cxx,圖文教程

a) 雙擊 "輸出"窗口中的錯誤行, 此時會在 "代碼窗口" 中出現(xiàn)錯誤的位置.如下圖:
vs2010,編譯,log4cxx,圖文教程

b) 選擇 LOG4CXX_LIST_DEF, 按鍵盤 F12,此時會跳轉到該宏的定義,如下圖:

vs2010,編譯,log4cxx,圖文教程

c) 將

#define LOG4CXX_LIST_DEF(N, T) /
template class LOG4CXX_EXPORTstd::allocator<T>; /
template class LOG4CXX_EXPORTstd::vector<T>; /
typedef std::vector<T>N

替換為:
#define LOG4CXX_LIST_DEF(N, T) /
typedef std::vector<T>N

vs2010,編譯,log4cxx,圖文教程
 

14、按照13修改后,重新編譯

出現(xiàn)

2>network_io/unix/multicast.c(137): errorC2079: “mip”使用未定義的struct“group_source_req”錯誤

 

雙擊第一行出錯輸出, 將 136 和 148 行的 #if MCAST_JOIN_SOURCE_GROUP 注釋,替換為 #if defined (group_source_req)

vs2010,編譯,log4cxx,圖文教程
 

 

15、按照14修改后,重新編譯

 

出現(xiàn)

'4>../src/main/cpp/stringhelper.cpp(64):error C2039: “insert_iterator”: 不是“std”的成員'等錯誤.

vs2010,編譯,log4cxx,圖文教程
 

 

在該 .cpp中(stringhelper.cpp) 加入頭文件#include<iterator>

vs2010,編譯,log4cxx,圖文教程
 

 

16、按照15修改后,重新編譯

出現(xiàn) '無法解析的外部符號 xxx'等錯誤.

vs2010,編譯,log4cxx,圖文教程
 

 

將 apr, aprutil, xml添加至 log4cxx 的引用中.(按照下面4副圖的順序操作)

vs2010,編譯,log4cxx,圖文教程


vs2010,編譯,log4cxx,圖文教程

 

vs2010,編譯,log4cxx,圖文教程
 

vs2010,編譯,log4cxx,圖文教程
 

 

17.選擇重新生成解決方案.

vs2010,編譯,log4cxx,圖文教程


 

 

編譯成功后:

vs2010,編譯,log4cxx,圖文教程

 

到此log4cxx編譯就完成了。

本文就到這里了,希望小伙伴們能夠喜歡。


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 泌阳县| 华宁县| 靖州| 塔城市| 北川| 阿拉尔市| 五寨县| 盐池县| 钟山县| 西昌市| 萨嘎县| 平和县| 和顺县| 南投县| 潜江市| 崇信县| 永年县| 高青县| 剑川县| 佛坪县| 烟台市| 杭锦后旗| 桐柏县| 密山市| 大庆市| 增城市| 闽侯县| 陇南市| 延庆县| 新泰市| 天气| 景谷| 齐齐哈尔市| 安国市| 图木舒克市| 九龙县| 小金县| 西峡县| 灵台县| 樟树市| 得荣县|