zhangyuanwei / node-images

Cross-platform image decoder(png/jpeg/gif) and encoder(png/jpeg) for Nodejs
https://npmjs.org/package/images
MIT License
1.56k stars 205 forks source link

Windows下编译出错 #146

Closed painty closed 5 years ago

painty commented 6 years ago

最终的目的是想为electron编译可用的包。系统是Windows 10 x64,步骤是

  1. 安装 node-gyp npm install -g node-gyp
  2. 安装 windows-build-tools npm install --global --production windows-build-tools
  3. 然后git clone https://github.com/zhangyuanwei/node-images
  4. 然后按照 #45 说的执行
$ cd node-images
$ git submodule init
$ git submodule update

windows下没有sh,我就手动按照third-party.sh里面写的下载了对应的文件包解压到相应的目录,然后cmake了libjpeg-turbo

然后执行下面两句

$ npm install
$ node-gyp rebuild

在执行rebuild时候,红色字报错停留在

Creating library D:\node-images\build\Release\binding.lib and object D:\node-images\build\Release\binding.exp
Image.obj : error LNK2001: unresolved external symbol "enum ImageState __cdecl rotate(struct PixelArray *,struct PixelArray *,unsigned __int64)" (?rotate@@YA?AW4ImageState@@PEAUPixelArray@@0_K@Z) [D:\node-images\build\binding.vcxproj]
giflib.lib(dgif_lib.obj) : error LNK2001: unresolved external symbol reallocarray [D:\node-images\build\binding.vcxproj]
D:\node-images\build\Release\binding.node : fatal error LNK1120: 2 unresolved externals [D:\node-images\build\binding.vcxproj]