elad / node-imagemagick-native

ImageMagick's Magick++ bindings for NodeJS
629 stars 132 forks source link

Not building on x86 Windows #5

Closed daguej closed 11 years ago

daguej commented 11 years ago

Running on Win 7 x64 (32-bit node), I get:

c:\program files (x86)\imagemagick-6.8.5-q16\include\magick/magick-baseconfig.h(182): error C2371: 'ssize_t' : redefinition; different basic types

D:\Users\Josh\Documents\js\node-imagemagick-native>node-gyp rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@0.8.1
gyp info using node@0.10.13 | win32 | ia32
gyp info spawn python
gyp info spawn args [ 'D:\\Users\\Josh\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Users\\Josh\\Documents\\js\\node-imagemagick-native\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Users\\Josh\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Users\\Josh\\.node-gyp\\0.10.13\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=D:\\Users\\Josh\\.node-gyp\\0.10.13',
gyp info spawn args   '-Dmodule_root_dir=D:\\Users\\Josh\\Documents\\js\\node-imagemagick-native',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'D:\\Users\\Josh\\Documents\\js\\node-imagemagick-native\\build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/clp:Verbosity=minimal',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=Win32' ]
  imagemagick.cc
c:\program files (x86)\imagemagick-6.8.5-q16\include\magick/magick-baseconfig.h(182): error C2371: 'ssize_t' : redefinition; different basic types [D:\Users\Josh\Docum ents\js\node-imagemagick-native\build\imagemagick.vcxproj]
          d:\users\josh\.node-gyp\0.10.13\deps\uv\include\uv-private/uv-win.h(27) : see declaration of 'ssize_t'
c:\program files (x86)\imagemagick-6.8.5-q16\include\magick/pixel-accessor.h(163): warning C4244: 'argument' : conversion from 'double' to 'const MagickCore::MagickRea lType', possible loss of data [D:\Users\Josh\Documents\js\node-imagemagick-native\build\imagemagick.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify / EHsc [D:\Users\Josh\Documents\js\node-imagemagick-native\build\imagemagick.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Users\Josh\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:232:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "D:\\Users\\Josh\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Users\Josh\Documents\js\node-imagemagick-native
gyp ERR! node -v v0.10.13
gyp ERR! node-gyp -v v0.8.1
gyp ERR! not ok
daguej commented 11 years ago

@fivethreeo, do you have any insight?

fivethreeo commented 11 years ago

I think it tries to build with .net framework and not msvce 2010.

daguej commented 11 years ago

Despite the fact that msbuild runs out of C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe, I don't believe it's trying to build with .NET. I have VS2010 Ultimate, not VC2010 Express, so my C++ compilation tools might be installed in a slightly different place than where Express puts them.

fivethreeo commented 11 years ago

Try a node-gyp configure and node-gyp build -v and post the output.

daguej commented 11 years ago
D:\Users\Josh\Documents\js\node-imagemagick-native>node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@0.8.1
gyp info using node@0.10.13 | win32 | ia32
gyp info spawn python
gyp info spawn args [ 'D:\\Users\\Josh\\AppData\\Roaming\\npm\\node_modules\\nod
e-gyp\\gyp\\gyp',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Users\\Josh\\Documents\\js\\node-imagemagick-native\\
build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Users\\Josh\\AppData\\Roaming\\npm\\node_modules\\nod
e-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Users\\Josh\\.node-gyp\\0.10.13\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=D:\\Users\\Josh\\.node-gyp\\0.10.13',
gyp info spawn args   '-Dmodule_root_dir=D:\\Users\\Josh\\Documents\\js\\node-im
agemagick-native',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'D:\\Users\\Josh\\Documents\\js\\node-imagemagick-native\\
build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp info ok

D:\Users\Josh\Documents\js\node-imagemagick-native>node-gyp build -v
gyp info it worked if it ends with ok
gyp verb cli [ 'node',
gyp verb cli   'D:\\Users\\Josh\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\
bin\\node-gyp.js',
gyp verb cli   'build',
gyp verb cli   '-v' ]
gyp info using node-gyp@0.8.1
gyp info using node@0.10.13 | win32 | ia32
gyp verb command build []
gyp verb build type Release
gyp verb architecture ia32
gyp verb node dev dir D:\Users\Josh\.node-gyp\0.10.13
gyp verb found first Solution file build/binding.sln
gyp verb could not find "msbuild.exe". guessing location
gyp verb "Release" dir needed to be created? null
gyp verb copying "node.lib" for ia32 D:\Users\Josh\.node-gyp\0.10.13\Release\nod
e.lib
gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
gyp info spawn args [ 'build/binding.sln',
gyp info spawn args   '/nologo',
gyp info spawn args   '/p:Configuration=Release;Platform=Win32' ]
Build started 7/11/2013 3:57:13 PM.
Project "D:\Users\Josh\Documents\js\node-imagemagick-native\build\binding.sln"
on node 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Release|Win32".
Project "D:\Users\Josh\Documents\js\node-imagemagick-native\build\binding.sln"
(1) is building "D:\Users\Josh\Documents\js\node-imagemagick-native\build\image
magick.vcxproj" (2) on node 1 (default targets).
InitializeBuildStatus:
  Touching "Release\obj\imagemagick\imagemagick.unsuccessfulbuild".
ClCompile:
  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /I"D:\Us
  ers\Josh\.node-gyp\0.10.13\src" /I"D:\Users\Josh\.node-gyp\0.10.13\deps\uv\in
  clude" /I"D:\Users\Josh\.node-gyp\0.10.13\deps\v8\include" /I"C:\Program File
  s (x86)\ImageMagick-6.8.5-Q16\include" /Zi /nologo /W3 /WX- /Ox /Ob2 /Oi /Ot
  /Oy /GL /D WIN32 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D
  BUILDING_V8_SHARED=1 /D BUILDING_UV_SHARED=1 /D BUILDING_NODE_EXTENSION /D _W
  INDLL /GF /Gm- /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /GR- /Fo"Rele
  ase\obj\imagemagick\\" /Fd"Release\obj\imagemagick\vc100.pdb" /Gd /TP /wd4251
   /analyze- /errorReport:queue ..\src\imagemagick.cc /MP
  imagemagick.cc
c:\program files (x86)\imagemagick-6.8.5-q16\include\magick/magick-baseconfig.h
(182): error C2371: 'ssize_t' : redefinition; different basic types [D:\Users\J
osh\Documents\js\node-imagemagick-native\build\imagemagick.vcxproj]
          d:\users\josh\.node-gyp\0.10.13\deps\uv\include\uv-private/uv-win.h(2
  7) : see declaration of 'ssize_t'
c:\program files (x86)\imagemagick-6.8.5-q16\include\magick/pixel-accessor.h(16
3): warning C4244: 'argument' : conversion from 'double' to 'const MagickCore::
MagickRealType', possible loss of data [D:\Users\Josh\Documents\js\node-imagema
gick-native\build\imagemagick.vcxproj]
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [D:\Users\Josh\Documents\js\node-imagemagick-native\build\imagema
gick.vcxproj]
Done Building Project "D:\Users\Josh\Documents\js\node-imagemagick-native\build
\imagemagick.vcxproj" (default targets) -- FAILED.

Done Building Project "D:\Users\Josh\Documents\js\node-imagemagick-native\build
\binding.sln" (default targets) -- FAILED.

Build FAILED.
"D:\Users\Josh\Documents\js\node-imagemagick-native\build\binding.sln" (default
 target) (1) ->
"D:\Users\Josh\Documents\js\node-imagemagick-native\build\imagemagick.vcxproj"
(default target) (2) ->
(ClCompile target) ->
  c:\program files (x86)\imagemagick-6.8.5-q16\include\magick/pixel-accessor.h(
163): warning C4244: 'argument' : conversion from 'double' to 'const MagickCore
::MagickRealType', possible loss of data [D:\Users\Josh\Documents\js\node-image
magick-native\build\imagemagick.vcxproj]
  C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323):
warning C4530: C++ exception handler used, but unwind semantics are not enabled
. Specify /EHsc [D:\Users\Josh\Documents\js\node-imagemagick-native\build\image
magick.vcxproj]

"D:\Users\Josh\Documents\js\node-imagemagick-native\build\binding.sln" (default
 target) (1) ->
"D:\Users\Josh\Documents\js\node-imagemagick-native\build\imagemagick.vcxproj"
(default target) (2) ->
(ClCompile target) ->
  c:\program files (x86)\imagemagick-6.8.5-q16\include\magick/magick-baseconfig
.h(182): error C2371: 'ssize_t' : redefinition; different basic types [D:\Users
\Josh\Documents\js\node-imagemagick-native\build\imagemagick.vcxproj]

    2 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.13
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (D:\Users\Josh\AppData\Roaming\npm\nod
e_modules\node-gyp\lib\build.js:232:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:
12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "D:\\Users\\Josh\\AppData\\Roaming\\npm\\node_modules\\n
ode-gyp\\bin\\node-gyp.js" "build" "-v"
gyp ERR! cwd D:\Users\Josh\Documents\js\node-imagemagick-native
gyp ERR! node -v v0.10.13
gyp ERR! node-gyp -v v0.8.1
gyp ERR! not ok
fivethreeo commented 11 years ago

Which Dll release did you get of ImageMagic, make sure you get the 32 bit one.

daguej commented 11 years ago

ImageMagick is ImageMagick-6.8.5-10-Q16-x86-dll -- it is the 32-bit release.

fivethreeo commented 11 years ago

Did you install dotnet x64?

On 12 July 2013 02:26, Josh Dague notifications@github.com wrote:

ImageMagick is ImageMagick-6.8.5-10-Q16-x86-dll -- it is the 32-bit release.

— Reply to this email directly or view it on GitHubhttps://github.com/mash/node-imagemagick-native/issues/5#issuecomment-20851728 .

Øyvind Saltvik

daguej commented 11 years ago

Yes, but it includes the x86 compiler, which is the one that's being used to compile IM.

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe is a 32-bit executable.

The x64 compiler is in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64

fivethreeo commented 11 years ago

But it seems like size_t is redefined wronng, some 64 bit h files?

On 12 July 2013 16:16, Josh Dague notifications@github.com wrote:

Yes, but it includes the x86 compiler, which is the one that's being used to compile IM.

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe

Reply to this email directly or view it on GitHubhttps://github.com/mash/node-imagemagick-native/issues/5#issuecomment-20878970 .

Øyvind Saltvik

daguej commented 11 years ago

It looks like the definition of ssize_t is coming from d:\users\josh\.node-gyp\0.10.13\deps\uv\include\uv-private/uv-win.h

#if !defined(_SSIZE_T_) && !defined(_SSIZE_T_DEFINED)
typedef intptr_t ssize_t;
# define _SSIZE_T_
# define _SSIZE_T_DEFINED
#endif

Which conflicts with C:\Program Files (x86)\ImageMagick-6.8.5-Q16\include\magick\magick-baseconfig.h

#if !defined(ssize_t) && !defined(__MINGW32__) && !defined(__MINGW64__)
#if defined(_WIN64) 
typedef __int64 ssize_t;
#else
typedef long ssize_t;
#endif
#endif
fivethreeo commented 11 years ago

Need to find a way to make gyp define ssize_t on win 32 and let uw-win redefine it.

On 12 July 2013 17:50, Josh Dague notifications@github.com wrote:

It looks like the definition of ssize_t is coming from d:\users\josh.node-gyp\0.10.13\deps\uv\include\uv-private/uv-win.h

if !defined(_SSIZET) && !defined(_SSIZE_T_DEFINED)

typedef intptr_t ssize_t;

define _SSIZET

define _SSIZE_T_DEFINED

endif

Which conflicts with C:\Program Files (x86)\ImageMagick-6.8.5-Q16\include\magick\magick-baseconfig.h

if !defined(ssize_t) && !defined(MINGW32) && !defined(MINGW64)

if defined(_WIN64)

typedef __int64 ssize_t;

else

typedef long ssize_t;

endif

endif

— Reply to this email directly or view it on GitHubhttps://github.com/mash/node-imagemagick-native/issues/5#issuecomment-20885268 .

Øyvind Saltvik

fivethreeo commented 11 years ago

Try this https://github.com/fivethreeo/node-imagemagick-native one.

On 12 July 2013 19:50, Øyvind Saltvik oyvind.saltvik@gmail.com wrote:

Need to find a way to make gyp define ssize_t on win 32 and let uw-win redefine it.

On 12 July 2013 17:50, Josh Dague notifications@github.com wrote:

It looks like the definition of ssize_t is coming from d:\users\josh.node-gyp\0.10.13\deps\uv\include\uv-private/uv-win.h

if !defined(_SSIZET) && !defined(_SSIZE_T_DEFINED)

typedef intptr_t ssize_t;

define _SSIZET

define _SSIZE_T_DEFINED

endif

Which conflicts with C:\Program Files (x86)\ImageMagick-6.8.5-Q16\include\magick\magick-baseconfig.h

if !defined(ssize_t) && !defined(MINGW32) && !defined(MINGW64)

if defined(_WIN64)

typedef __int64 ssize_t;

else

typedef long ssize_t;

endif

endif

— Reply to this email directly or view it on GitHubhttps://github.com/mash/node-imagemagick-native/issues/5#issuecomment-20885268 .

Øyvind Saltvik

Øyvind Saltvik

fivethreeo commented 11 years ago

Hm does not work either it, this is a issue with magick ++ it seems.

On 12 July 2013 20:35, Øyvind Saltvik oyvind.saltvik@gmail.com wrote:

Try this https://github.com/fivethreeo/node-imagemagick-native one.

On 12 July 2013 19:50, Øyvind Saltvik oyvind.saltvik@gmail.com wrote:

Need to find a way to make gyp define ssize_t on win 32 and let uw-win redefine it.

On 12 July 2013 17:50, Josh Dague notifications@github.com wrote:

It looks like the definition of ssize_t is coming from d:\users\josh.node-gyp\0.10.13\deps\uv\include\uv-private/uv-win.h

if !defined(_SSIZET) && !defined(_SSIZE_T_DEFINED)

typedef intptr_t ssize_t;

define _SSIZET

define _SSIZE_T_DEFINED

endif

Which conflicts with C:\Program Files (x86)\ImageMagick-6.8.5-Q16\include\magick\magick-baseconfig.h

if !defined(ssize_t) && !defined(MINGW32) && !defined(MINGW64)

if defined(_WIN64)

typedef __int64 ssize_t;

else

typedef long ssize_t;

endif

endif

— Reply to this email directly or view it on GitHubhttps://github.com/mash/node-imagemagick-native/issues/5#issuecomment-20885268 .

Øyvind Saltvik

Øyvind Saltvik

Øyvind Saltvik

daguej commented 11 years ago

FWIW, I tried changing magick-baseconfig.h:182 from typedef long ssize_t to typedef intptr_t ssize_t, and got a slightly different error:

imagemagick.obj : error LNK2001: unresolved external symbol "public: __thiscall
 Magick::Geometry::Geometry(unsigned int,unsigned int,int,int,bool,bool)" (??0G eometry@Magick@@QAE@IIHH_N0@Z) [D:\Users\Josh\Documents\js\node-imagemagick-nat ive\build\imagemagick.vcxproj]
D:\Users\Josh\Documents\js\node-imagemagick-native\build\Release\imagemagick.no de : fatal error LNK1120: 1 unresolved externals [D:\Users\Josh\Documents\js\no de-imagemagick-native\build\imagemagick.vcxproj]
fivethreeo commented 11 years ago

Ah, libs are built with long ssize_t ;)

On 12 July 2013 20:54, Josh Dague notifications@github.com wrote:

FWIW, I tried changing magick-baseconfig.h:182 from typedef long ssize_tto typedef intptr_t ssize_t, and got a slightly different error:

imagemagick.obj : error LNK2001: unresolved external symbol "public: __thiscall Magick::Geometry::Geometry(unsigned int,unsigned int,int,int,bool,bool)" (??0G eometry@Magick@@QAE@IIHH_N0@Z) [D:\Users\Josh\Documents\js\node-imagemagick-nat ive\build\imagemagick.vcxproj] D:\Users\Josh\Documents\js\node-imagemagick-native\build\Release\imagemagick.no de : fatal error LNK1120: 1 unresolved externals [D:\Users\Josh\Documents\js\no de-imagemagick-native\build\imagemagick.vcxproj]

— Reply to this email directly or view it on GitHubhttps://github.com/mash/node-imagemagick-native/issues/5#issuecomment-20896997 .

Øyvind Saltvik

daguej commented 11 years ago

Posted to the IM forums: http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=23748

daguej commented 11 years ago

Also: I've tried building in a pure x86 VM and get the same errors, so this issue is x86 in general, not just because my machine is x64.

fivethreeo commented 11 years ago

Try my repo now.

On 13 July 2013 00:40, Josh Dague notifications@github.com wrote:

Also: I've tried building in a pure x86 VM and get the same errors, so this issue is x86 in general, not just because my machine is x64.

— Reply to this email directly or view it on GitHubhttps://github.com/mash/node-imagemagick-native/issues/5#issuecomment-20908315 .

Øyvind Saltvik

daguej commented 11 years ago

That does it. You're a hero.

daguej commented 11 years ago

Installs successfully from npm on x86 now. Thanks guys!

mash commented 11 years ago

Thank you too