Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Can't build node-png on Win8.1 x64 with node v0.10.26 #41

Closed
bux opened this Issue Mar 18, 2014 · 2 comments

Comments

Projects
None yet
3 participants

bux commented Mar 18, 2014

I get the following errors:

png_encoder.obj : error LNK2001: unresolved external symbol png_write_info [C:\ ...\node_modules\node-png\build\png.vcxproj]
png_encoder.obj : error LNK2001: unresolved external symbol png_set_invert_alpha [C:\ ...\node_modules\node-png\build\png.vcxproj]
png_encoder.obj : error LNK2001: unresolved external symbol png_write_image [C:\ ...\node_modules\node-png\build\png.vcxproj]
png_encoder.obj : error LNK2001: unresolved external symbol png_destroy_write_struct [C:\ ...\node_modules\node-png\build\png.vcxproj]
png_encoder.obj : error LNK2001: unresolved external symbol png_set_write_fn [C:\ ...\node_modules\node-png\build\png.vcxproj]
png_encoder.obj : error LNK2001: unresolved external symbol png_write_end [C:\ ...\node_modules\node-png\build\png.vcxproj]
png_encoder.obj : error LNK2001: unresolved external symbol png_get_io_ptr [C:\ ...\node_modules\node-png\build\png.vcxproj]
png_encoder.obj : error LNK2001: unresolved external symbol png_create_info_struct [C:\ ...\node_modules\node-png\build\png.vcxproj]
png_encoder.obj : error LNK2001: unresolved external symbol png_create_write_struct [C:\ ...\node_modules\node-png\build\png.vcxproj]
png_encoder.obj : error LNK2001: unresolved external symbol png_set_bgr [C:\ ...\node_modules\node-png\build\png.vcxproj]
png_encoder.obj : error LNK2001: unresolved external symbol png_set_IHDR [C:\ ...\node_modules\node-png\build\png.vcxproj]
C:\ ...\node_modules\node-png\build\Release\png.node : fatal error LNK1120: 11 unresolved externals [C:\ ...\node_modules\node-png\build\png.vcxproj]

I'm using Python2.7, VS2012 Express

NedimBo commented Mar 19, 2014

Same error here with Win7 x64, Python2.7 msbuild(.net v4.0.30319).
But i had no problems on ArchLinux.
Any idea about that problem?

BUILD LOG:

1>------ Rebuild All started: Project: png, Configuration: Release x64 ------
1> common.cpp
1> png_encoder.cpp
1> png.cpp
1> fixed_png_stack.cpp
1> dynamic_png_stack.cpp
1> module.cpp
1> buffer_compat.cpp
1>..\src\png_encoder.cpp(23): warning C4267: '+=' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>..\src\png_encoder.cpp(26): warning C4267: '+=' : conversion from 'size_t' to 'unsigned int', possible loss of data
1>..\src\png_encoder.cpp(75): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>..\src\png_encoder.cpp(107): warning C4101: 'err' : unreferenced local variable
1>C:\Users\NedimBo.node-gyp\0.10.26\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent v8::Persistent::New(v8::Handle)'
1> with
1> [
1> T=v8::Object
1> ]
1>C:\Users\NedimBo.node-gyp\0.10.26\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent v8::Persistent::New(v8::Handle)'
1> with
1> [
1> T=v8::Object
1> ]
1>..\src\png.cpp(35): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>..\src\fixed_png_stack.cpp(58): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>C:\Users\NedimBo.node-gyp\0.10.26\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent v8::Persistent::New(v8::Handle)'
1> with
1> [
1> T=v8::Object
1> ]
1>C:\Users\NedimBo.node-gyp\0.10.26\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent v8::Persistent::New(v8::Handle)'
1> with
1> [
1> T=v8::Object
1> ]
1>C:\Users\NedimBo.node-gyp\0.10.26\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent v8::Persistent::New(v8::Handle)'
1> with
1> [
1> T=v8::Object
1> ]
1>..\src\dynamic_png_stack.cpp(77): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
1>..\src\dynamic_png_stack.cpp(78): warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
1>C:\Users\NedimBo.node-gyp\0.10.26\deps\v8\include\v8.h(218): warning C4506: no definition for inline function 'v8::Persistent v8::Persistent::New(v8::Handle)'
1> with
1> [
1> T=v8::Object
1> ]
1>C:\Users\NedimBo.node-gyp\0.10.26\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent v8::Persistent::New(v8::Handle)'
1> with
1> [
1> T=v8::Object
1> ]
1> Creating library C:\Users\NedimBo\node-png\build\Release\png.lib and object C:\Users\NedimBo\node-png\build\Release\png.exp
1>png_encoder.obj : error LNK2001: unresolved external symbol png_write_info
1>png_encoder.obj : error LNK2001: unresolved external symbol png_set_invert_alpha
1>png_encoder.obj : error LNK2001: unresolved external symbol png_write_image
1>png_encoder.obj : error LNK2001: unresolved external symbol png_destroy_write_struct
1>png_encoder.obj : error LNK2001: unresolved external symbol png_set_write_fn
1>png_encoder.obj : error LNK2001: unresolved external symbol png_write_end
1>png_encoder.obj : error LNK2001: unresolved external symbol png_get_io_ptr
1>png_encoder.obj : error LNK2001: unresolved external symbol png_create_info_struct
1>png_encoder.obj : error LNK2001: unresolved external symbol png_create_write_struct
1>png_encoder.obj : error LNK2001: unresolved external symbol png_set_bgr
1>png_encoder.obj : error LNK2001: unresolved external symbol png_set_IHDR

The binaries of zlib & libpng are for x86
The solution is to recompile libpng for x64
No major hurdle with VC++ 2010 Express
Don't forget to install Windows SDK 7.1, and to patch the compiler (like for other x64 node.js binary module)
download both zlib and libpng from their respective website
put both on them in the same directory (libpng will need zlib source to compile)
Then in libpng/projects/vstudio you will have the solution
Before to compile you will need to change the platform for each project (it need to be x64)
Then compile zlib, then pnglibconf, then libpng
Then replace header & binaries in the module directory gyp/include and gyp/lib
And you can compile the module

@bux bux closed this Aug 30, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment