从源代码编译 Inkscape 时出错
Error while compiling Inkscape from source code
我不太了解如何处理 C++ 项目,因此我下载了 Inkscape from its GitLab repository and made few changes (adding small feature) and tried to compile based on the instruction provided in INSTALL.md 的源代码以及他们网站上提供的其他资源。
虽然看起来我已经在系统上安装了所有依赖项,但在构建文件夹中 运行 cmake 之后我得到了这个结果:
------------------------------
Building Makefile for Inkscape
------------------------------
Source Dir: /home/user/myProgs/inkscape
Binary Dir: /home/user/myProgs/inkscape/build
-- Creating build files in: /home/user/myProgs/inkscape/build
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found GTest: /usr/lib/libgtest.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for modules 'harfbuzz;pangocairo;pangoft2;fontconfig;gsl;gmodule-2.0;libsoup-2.4>=2.42'
--
CMake Error at /usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:415 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:588 (_pkg_check_modules_internal)
CMakeScripts/DefineDependsandFlags.cmake:42 (pkg_check_modules)
CMakeLists.txt:136 (include)
-- Configuring incomplete, errors occurred!
See also "/home/user/myProgs/inkscape/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/myProgs/inkscape/build/CMakeFiles/CMakeError.log".
DefineDependsandFlags.cmake:42 中的相关行是:
pkg_check_modules(INKSCAPE_DEP REQUIRED
harfbuzz
pangocairo
pangoft2
fontconfig
gsl
gmodule-2.0
libsoup-2.4>=2.42)
据我检查,所有这些软件包都已安装在我的系统上。
这是 CMakeError.log 的内容,其中这些行可能会提供一些线索:
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_d21be.dir/CheckFunctionExists.c.o -o cmTC_d21be -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_d21be.dir/build.make:97: recipe for target 'cmTC_d21be' failed
make[1]: *** [cmTC_d21be] Error 1
make[1]: Leaving directory '/home/user/myProgs/inkscape/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_d21be/fast' failed
make: *** [cmTC_d21be/fast] Error 2
我在 Internet 上搜索没有找到任何帮助。
任何帮助,将不胜感激。
我已经尝试在 Kubuntu 17.04 和 Ubuntu 16.04 LTS
上编译
为了编译源代码,您需要安装一些缺少的依赖项。根据你的cmake结果:
A required package was not found
Ubuntu(经过 Kubuntu 测试)中最简单的方法是从 ppa 存储库安装 Inkscape 开发包。在终端中键入以下命令,然后按 Enter:
sudo add-apt-repository ppa:inkscape.dev/trunk
之后您需要启用源代码存储库。尝试取消注释 deb-src
行。 (去掉开头的#):
sudo vim /etc/apt/sources.list.d/inkscape_dev-ubuntu-trunk-zesty.list
- 注意您可以使用自己喜欢的文本编辑器代替 vim。
现在使用 sudo apt update
更新软件包列表。接下来您就可以安装开发包了:
sudo apt build-dep inkscape-trunk
现在可以编译了,运行 ;)
我不太了解如何处理 C++ 项目,因此我下载了 Inkscape from its GitLab repository and made few changes (adding small feature) and tried to compile based on the instruction provided in INSTALL.md 的源代码以及他们网站上提供的其他资源。
虽然看起来我已经在系统上安装了所有依赖项,但在构建文件夹中 运行 cmake 之后我得到了这个结果:
------------------------------
Building Makefile for Inkscape
------------------------------
Source Dir: /home/user/myProgs/inkscape
Binary Dir: /home/user/myProgs/inkscape/build
-- Creating build files in: /home/user/myProgs/inkscape/build
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found GTest: /usr/lib/libgtest.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Checking for modules 'harfbuzz;pangocairo;pangoft2;fontconfig;gsl;gmodule-2.0;libsoup-2.4>=2.42'
--
CMake Error at /usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:415 (message):
A required package was not found
Call Stack (most recent call first):
/usr/share/cmake-3.7/Modules/FindPkgConfig.cmake:588 (_pkg_check_modules_internal)
CMakeScripts/DefineDependsandFlags.cmake:42 (pkg_check_modules)
CMakeLists.txt:136 (include)
-- Configuring incomplete, errors occurred!
See also "/home/user/myProgs/inkscape/build/CMakeFiles/CMakeOutput.log".
See also "/home/user/myProgs/inkscape/build/CMakeFiles/CMakeError.log".
DefineDependsandFlags.cmake:42 中的相关行是:
pkg_check_modules(INKSCAPE_DEP REQUIRED
harfbuzz
pangocairo
pangoft2
fontconfig
gsl
gmodule-2.0
libsoup-2.4>=2.42)
据我检查,所有这些软件包都已安装在我的系统上。
这是 CMakeError.log 的内容,其中这些行可能会提供一些线索:
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_d21be.dir/CheckFunctionExists.c.o -o cmTC_d21be -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_d21be.dir/build.make:97: recipe for target 'cmTC_d21be' failed
make[1]: *** [cmTC_d21be] Error 1
make[1]: Leaving directory '/home/user/myProgs/inkscape/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_d21be/fast' failed
make: *** [cmTC_d21be/fast] Error 2
我在 Internet 上搜索没有找到任何帮助。
任何帮助,将不胜感激。
我已经尝试在 Kubuntu 17.04 和 Ubuntu 16.04 LTS
上编译为了编译源代码,您需要安装一些缺少的依赖项。根据你的cmake结果:
A required package was not found
Ubuntu(经过 Kubuntu 测试)中最简单的方法是从 ppa 存储库安装 Inkscape 开发包。在终端中键入以下命令,然后按 Enter:
sudo add-apt-repository ppa:inkscape.dev/trunk
之后您需要启用源代码存储库。尝试取消注释 deb-src
行。 (去掉开头的#):
sudo vim /etc/apt/sources.list.d/inkscape_dev-ubuntu-trunk-zesty.list
- 注意您可以使用自己喜欢的文本编辑器代替 vim。
现在使用 sudo apt update
更新软件包列表。接下来您就可以安装开发包了:
sudo apt build-dep inkscape-trunk
现在可以编译了,运行 ;)