我正在尝试使用tar文件whalebot
配置whalebot-0.02.00.tar.gz
搜寻器。我已经用以下方法正确提取了它:
root@Admin1:~/dls# tar xvzf whalebot-0.02.00.tar.gz
之后,我想用以下命令配置它:
root@Admin1:~/dls/whalebot# ./configure
它给我错误:
我也已经运行了命令:
root@Admin1:~/dls/whalebot# cmake ./
它给我以下结果:
root@Admin1:~/dls/whalebot# cmake ./
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Boost version: 1.44.0
-- Found the following Boost libraries:
-- filesystem
-- system
-- thread
-- program_options
-- date_time
CMake Warning (dev) at webspider/CMakeLists.txt:25 (link_directories):
This command specifies the relative path
../statsem_string/bin
as a link directory.
Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run "cmake --help-policy CMP0015" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at webspider/CMakeLists.txt:25 (link_directories):
This command specifies the relative path
../3dparty/google-url
as a link directory.
Policy CMP0015 is not set: link_directories() treats paths relative to the
source dir. Run "cmake --help-policy CMP0015" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
HTMLCXX_LIBRARY
linked by target "whalebot" in directory /root/dls/whalebot/webspider
-- Configuring incomplete, errors occurred!
我该如何进行?
最佳答案
看来CMake无法找到htmlcxx库。
在whalebot documentation中,htmlcxx被列为依赖项。
您需要download htmlcxx,解压缩,然后安装:
cd <path to unzipped htmlcxx>
./configure --enable-static=on --enable-shared=off
make
sudo make install
您可能需要在
#include <cstddef>
的顶部添加html/tree.h
才能使其成功构建。默认情况下,它将安装到usr/local/
。如果还没有安装,还需要安装icu:
sudo apt-get install libicu-dev
最后,您现在可以构建并安装whalebot。同样,如果您安装了最新的Boost安装,制作可能会失败。
在
webspider/src/webspider_options.cpp
的第57行中,您需要将boost::filesystem::initial_path().native_directory_string()
替换为boost::filesystem::initial_path().string()
。然后,您应该可以很好地构建和安装:cd <path to unzipped whalebot>
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
sudo make install
默认情况下,这也将安装到
usr/local/
。