Rac*_*hel 12 ubuntu glib npm vips sharp
我正在尝试在 Ubuntu 16.04 LTS 上安装Sharp。
我原本没有vips,所以我安装了
sudo apt-get install libvips-dev
Run Code Online (Sandbox Code Playgroud)
这修复了第一个错误,但现在我遇到了另一个错误:
In file included from ../src/common.cc:25:0:
/usr/include/vips/vips8:35:25: fatal error: glib-object.h: No such file or directory
compilation terminated.
sharp.target.mk:115: recipe for target 'Release/obj.target/sharp/src/common.o' failed
make: *** [Release/obj.target/sharp/src/common.o] Error 1
make: Leaving directory '/home/rachel/node_modules/sharp/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js:269:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.15.0-36-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /home/rachel/node_modules/sharp
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
Run Code Online (Sandbox Code Playgroud)
所以,我弄清楚了 glib-object.h 属于哪个包并尝试安装它,但它已经安装了。事实上,该文件确实存在。
/usr/include/glib-2.0/glib-object.h
Run Code Online (Sandbox Code Playgroud)
经过大量浏览,我发现了一个类似的问题,他们询问标头的位置是否在 pkg-config --cflags vips-cpp 中。对于提问者来说不是,这导致了修复,但对我来说,它是(从底部开始的第二个)。
> pkg-config --cflags vips-cpp
-pthread -fopenmp -DMAGICKCORE_HDRI_ENABLE=0
-DMAGICKCORE_QUANTUM_DEPTH=16
-fopenmp -DMAGICKCORE_HDRI_ENABLE=0
-DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/include/libgsf-1
-I/usr/include/libxml2
-I/usr/include/x86_64-linux-gnu//ImageMagick-6
-I/usr/include/ImageMagick-6
-I/usr/include/x86_64-linux-gnu//ImageMagick-6
-I/usr/include/ImageMagick-6
-I/usr/include/orc-0.4
-I/usr/include/OpenEXR
-I/usr/include/openslide
-I/usr/lib/x86_64-linux-gnu/hdf5/serial/include
-I/usr/include/pango-1.0
-I/usr/include/harfbuzz
-I/usr/include/pango-1.0
-I/usr/include/freetype2
-I/usr/include/x86_64-linux-gnu
-I/usr/include/libpng12
-I/usr/include/libexif
-I/usr/include/glib-2.0
-I/usr/lib/x86_64-linux-gnu/glib-2.0/include
Run Code Online (Sandbox Code Playgroud)
一旦验证文件存在并且其文件夹包含在上述输出中,我还没有找到任何解决方案。我完全不知道接下来要做什么,所以任何建议将不胜感激。
npm 是全新安装(截至昨天),以防万一。
看起来 vips-cpp 正在寻找 GObject,而不是 GLib,但 pkg-config 文件只要求 GLib。GObject基于GLib,它们密切相关,但它们不是同一个项目。
您应该gobject-2.0以某种方式添加到 pkg-config 依赖项。您可以在 Sharp 构建系统中执行此操作(无论它在包中的任何位置vips-cpp,也使其依赖gobject-2.0)。您还可以修复vips-cpppkg-config 文件以添加gobject-2.0为依赖项;文件的位置取决于您的体系结构,但它是$LIBDIR/pkg-config/vips-cpp.pc.
| 归档时间: |
|
| 查看次数: |
6690 次 |
| 最近记录: |