---- 编译catch----
注意:此步不是必须的
1:先安装python
2:用cmake工具编译catch,注意:必须选择cmake gui中的file->delete cache菜单,
之后单击“configure”按钮,在弹出的编译器如:vs2017中一定得选x64或x86(依据你的需求决定)
-----windows 下 编译log4plus-----
1:先从git下载log4plus源码(https://github.com/log4cplus/log4cplus/tree/2.0.x),注意:有时下载下来的源码中没有catch、ThreadPool
,而git中是有的,重新到刚才log4plus源码的链接地址单独下载catch、ThreadPool,放到log4plus目录,
注意必须和git中的目录一致,ThreadPool.h fangzai /media/dansir/新加卷/work20200331/SoftWareAbout/Thirdpart/log4cplus-2.0.x/src
2: 用vs打开msvc14\log4cplus.sln
3: 将catch中的所有头文件加入到CLFSAppender工程中(或者你不嫌麻烦,每个工程中都加入也行),并在每个你要编译的工程中的属性->C/C++->预处理器->预处理器定义
中加入CATCH_CONFIG_WCHAR 、UNICODE、WIN32(或者你不嫌麻烦,每个工程中都加入也行),
如果不加上面几个预编译项,则会报:
: error C2511: “int Catch::Session::applyCommandLine(int,const wchar_t *const *)”:“Catch::Session”中没有找到重载的成员函数
error C2352: “Catch::Session::applyCommandLine”: 非静态成员函数的非法调用
4:编译所有工程
-----linux下 编译log4plus共享库-----
1:先从git下载log4plus源码(https://github.com/log4cplus/log4cplus/tree/2.0.x),注意:有时下载下来的源码中没有catch、ThreadPool
,而git中是有的,重新到刚才log4plus源码的链接地址单独下载catch、ThreadPool,放到log4plus目录,
注意必须和git中的目录一致,ThreadPool.h放到 Thirdpart/log4cplus-2.0.x/src 目录下,否则会报找不到ThreadPool.h文件错误
2: sudo ./configure
如果报:command not found,执行chmod +x configure,然后再执行上面的命令
3: make
4: sudo make install
-----linux下 编译log4plus静态库-----
其它步骤和编译log4plus共享库相同,第二步应改为:
./configure --enable-static