CMake错误:本项目中使用了以下变量,但它们被设置为NOTFOUND

2024-04-25

我正在尝试配置whalebot带有 tar 文件的爬虫whalebot-0.02.00.tar.gz。我已正确提取它:

root@Admin1:~/dls# tar xvzf whalebot-0.02.00.tar.gz

之后我想对其进行配置:

root@Admin1:~/dls/whalebot# ./configure

它给了我错误:

bash: ./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 库。

In the 鲸鱼机器人文档 http://code.google.com/p/whalebot/wiki/GettingStarted, htmlcxx 被列为依赖项。


你需要下载 htmlcxx http://sourceforge.net/projects/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 http://site.icu-project.org/如果您还没有安装,请安装:

sudo apt-get install libicu-dev

最后,您现在可以构建并安装 Whalebot。同样,如果您安装了相当最新的 boost,则 make 可能会失败。

在第 57 行webspider/src/webspider_options.cpp,你需要更换boost::filesystem::initial_path().native_directory_string() with 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/默认情况下。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

CMake错误:本项目中使用了以下变量,但它们被设置为NOTFOUND 的相关文章

随机推荐