Typedef ssize_t re-definition.
Posted: 2016-01-29T23:55:58-07:00
This post is almost 3 years old, but it shows the error I am getting.
https://www.imagemagick.org/discourse-s ... hp?t=23748
The github link at the bottom 404's.
I'm using Visual Studio 15.0 (VC 14) Enterprise using C++14 (I believe). The only thing I include is "Magick++.h". I installed the x86-dll version with the C/C++ headers and add:
C:\Program Files (x86)\ImageMagick-6.9.3-Q16\include
C:\Program Files (x86)\ImageMagick-6.9.3-Q16\libs
to my include and library paths respectively. The error I am getting now is:
The problem is that Python.h, because this is a python extension, ALSO defines ssize_t.
I've attempted a couple other solutions like including magick\MagickCore.h first and other things. I need to know the correct way in which I need to include my files.
Thanks, everyone!
Possible Solution:
Including Python.h first and then writing:
#define ssize_t ssize_t
seems to work. However, it should me stated that Python defines it as:
typedef _W64 int ssize_t;
Whereas ImageMagick defines it as:
typedef long ssize_t;
So I hope I don't run into issues O.o I'm going to though, right?
https://www.imagemagick.org/discourse-s ... hp?t=23748
The github link at the bottom 404's.
I'm using Visual Studio 15.0 (VC 14) Enterprise using C++14 (I believe). The only thing I include is "Magick++.h". I installed the x86-dll version with the C/C++ headers and add:
C:\Program Files (x86)\ImageMagick-6.9.3-Q16\include
C:\Program Files (x86)\ImageMagick-6.9.3-Q16\libs
to my include and library paths respectively. The error I am getting now is:
Code: Select all
'ssize_t': redefinition; different basic types - magick\magick-baseconfig.h:236
Code: Select all
#if !defined(ssize_t) && !defined(__MINGW32__) && !defined(__MINGW64__)
#if defined(_WIN64)
typedef __int64 ssize_t;
#else
typedef long ssize_t;
#endif
#endif
I've attempted a couple other solutions like including magick\MagickCore.h first and other things. I need to know the correct way in which I need to include my files.
Thanks, everyone!
Possible Solution:
Including Python.h first and then writing:
#define ssize_t ssize_t
seems to work. However, it should me stated that Python defines it as:
typedef _W64 int ssize_t;
Whereas ImageMagick defines it as:
typedef long ssize_t;
So I hope I don't run into issues O.o I'm going to though, right?