Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux ld:找不到-lX11或-lpng_Linux_Npm_Ld - Fatal编程技术网

Linux ld:找不到-lX11或-lpng

Linux ld:找不到-lX11或-lpng,linux,npm,ld,Linux,Npm,Ld,运行npm install face recognition在我的mac上运行良好,但当我尝试在我的Debian VM上运行时,它失败了,出现以下错误: SOLINK_MODULE(target) Release/obj.target/facerec.node /usr/bin/ld: cannot find -lX11 /usr/bin/ld: cannot find -lpng collect2: error: ld returned 1 exit status facerec.targ

运行
npm install face recognition
在我的mac上运行良好,但当我尝试在我的Debian VM上运行时,它失败了,出现以下错误:

  SOLINK_MODULE(target) Release/obj.target/facerec.node
/usr/bin/ld: cannot find -lX11
/usr/bin/ld: cannot find -lpng
collect2: error: ld returned 1 exit status
facerec.target.mk:157: recipe for target 'Release/obj.target/facerec.node' failed
make: *** [Release/obj.target/facerec.node] Error 1
make: Leaving directory '/home/ben/face-rec/node_modules/face-recognition/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.9.0-6-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ben/face-rec/node_modules/face-recognition
gyp ERR! node -v v8.11.3
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok 
npm WARN face-rec@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! face-recognition@0.9.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the face-recognition@0.9.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ben/.npm/_logs/2018-07-15T19_28_00_238Z-debug.log

我认为关键部分是第2行和第3行,关于
ld
无法找到
-lX11
-lpng
的部分。在mac上安装Xquartz很容易解决这个问题,但在Linux服务器上似乎不可能找到解决办法。有什么想法吗?

你简直错过了图书馆。试试这个:

apt-get install libpng-dev libx11

你只是错过了图书馆。试试这个:

apt-get install libpng-dev libx11

这个问题与作为标记使用的CMake有什么关系?不要将它与
make
混淆。当我最初编写问题时,我用cmake标记了它,因为它出现在错误消息中,但后来意识到它与问题无关。已删除。这些库是否已安装?这是我的问题,我不知道如何安装它们。可使用Apt安装,以满足第一个要求。同样地,
libpng-dev
(如有必要,
libpng++-dev
)将满足第二个要求。该问题与用作标记的CMake有何关系?不要将它与
make
混淆。当我最初编写问题时,我用cmake标记了它,因为它出现在错误消息中,但后来意识到它与问题无关。已删除。这些库是否已安装?这是我的问题,我不知道如何安装它们。可使用Apt安装,以满足第一个要求。同样地,
libpng-dev
(如有必要,
libpng++-dev
)将满足第二个要求。