从源代码编译Inkscape时出错 P>没有处理C++项目的知识,我已经从它的下载了源代码,并做了很少的修改(添加小的特性),并尝试在网站上提供的指令和其他可用的源代码编译。

从源代码编译Inkscape时出错 P>没有处理C++项目的知识,我已经从它的下载了源代码,并做了很少的修改(添加小的特性),并尝试在网站上提供的指令和其他可用的源代码编译。,c++,compilation,cmake,inkscape,C++,Compilation,Cmake,Inkscape,虽然我似乎在系统上安装了所有依赖项,但在build文件夹中运行cmake后,我得到了以下结果: ------------------------------ Building Makefile for Inkscape ------------------------------ Source Dir: /home/user/myProgs/inkscape Binary Dir: /home/user/myProgs/inkscape/build -- Creating build files

虽然我似乎在系统上安装了所有依赖项,但在build文件夹中运行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".
DefinedPendAndFlags.cmake:42中的相关行为:

pkg_check_modules(INKSCAPE_DEP REQUIRED
              harfbuzz
              pangocairo
          pangoft2
          fontconfig
          gsl
          gmodule-2.0
          libsoup-2.4>=2.42)
据我所知,我的系统上已经安装了所有这些软件包

以下是这些行可能提供一些线索的内容:

/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 
我在网上搜索时找不到任何帮助。
任何帮助都将不胜感激



我在Kubuntu 17.04和Ubuntu16.04 LTS上都试过编译,为了编译源代码,您需要安装一些缺少的依赖项。根据您的cmake结果:

A required package was not found
Ubuntu中最简单的方法(Kubuntu测试)是从ppa存储库安装Inkscape开发包。在终端中键入以下命令,然后按Enter键:

sudo add-apt-repository ppa:inkscape.dev/trunk
之后,您需要启用源代码存储库。尝试取消注释
deb src
行。(从开头删除#):

  • 注意您可以使用您喜爱的文本编辑器而不是vim
现在使用
sudo apt update
更新包列表。接下来,您可以安装开发包了:

sudo apt build dep inkscape trunk


现在,它已全部设置为编译和运行;)

这些库的开发包也安装了吗?库包本身不提供针对它们进行编译所需的C/C++头文件。另外:
/usr/bin/ld:找不到-lpthreads
——库是
pthread
,而不是
pthreads
。这看起来像是makefile中的输入错误。@cdhowie据我使用grep检查,没有调用-lpthreads的地方。
pthreads
错误与此无关,它是标准的CMake检查。它搜索正确的标志名称,在某些系统上是
-pthreads
。使用inkscape所需的所有软件包运行
pkg config
,并确保为每个软件包输出正确的标志。非常感谢。它解决了这个问题。我之前添加了PPA。我唯一没有做的就是取消对deb src的注释。我现在编译这个项目没有错误。
sudo vim /etc/apt/sources.list.d/inkscape_dev-ubuntu-trunk-zesty.list