magick wrote: ↑2019-10-07T03:02:35-07:00
The Windows configure script auto-generates magick-baseconfig.h. It includes a define for ssize_t as follows:
Code: Select all
#if !defined(ssize_t) && !defined(__MINGW32__)
#if defined(_WIN64)
typedef __int64 ssize_t;
#else
typedef long ssize_t;
#endif
#endif
Well... I was using the .h files from my Unix machine. I assumed the includes are the same across platforms. I was mistaken. I've replaced the .h files in the demo/demo/include folder with the Windows ones I generated when compiling IM, and now it's no longer complaining about ssize_t!
Now it's giving warnings about redefined preprocessor variables and deprecated Windows Kit methods:
Code: Select all
C:\Users\dan9e\Desktop\cartogrtist\ImageMagick-Windows\ImageMagick\Magick++\demo\demo\build>make
Scanning dependencies of target demo
[ 50%] Building CXX object CMakeFiles/demo.dir/src/demo.cpp.obj
In file included from C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/src/demo.cpp:13:
In file included from C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/include\Magick++.h:10:
In file included from C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/include\Magick++/Include.h:14:
In file included from C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/include\MagickCore/magick-config.h:25:
C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/include\MagickCore/magick-baseconfig.h(61,9): warning:
'MAGICKCORE_QUANTUM_DEPTH' macro redefined [-Wmacro-redefined]
#define MAGICKCORE_QUANTUM_DEPTH 16
^
<command line>(5,9): note: previous definition is here
#define MAGICKCORE_QUANTUM_DEPTH 8
^
In file included from C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/src/demo.cpp:13:
In file included from C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/include\Magick++.h:10:
In file included from C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/include\Magick++/Include.h:14:
In file included from C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/include\MagickCore/magick-config.h:25:
C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/include\MagickCore/magick-baseconfig.h(66,9): warning:
'MAGICKCORE_HDRI_ENABLE' macro redefined [-Wmacro-redefined]
#define MAGICKCORE_HDRI_ENABLE 1
^
<command line>(4,9): note: previous definition is here
#define MAGICKCORE_HDRI_ENABLE 0
^
C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/src/demo.cpp(31,8): warning: 'getenv' is deprecated: This function or
variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
[-Wdeprecated-declarations]
if(getenv("SRCDIR") != 0)
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdlib.h(1190,20): note: 'getenv' has been explicitly marked deprecated here
_Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s)
^
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include\vcruntime.h(309,55): note: expanded from macro
'_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include\vcruntime.h(299,47): note: expanded from macro
'_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/src/demo.cpp(32,16): warning: 'getenv' is deprecated: This function or
variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
[-Wdeprecated-declarations]
srcdir = getenv("SRCDIR");
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdlib.h(1190,20): note: 'getenv' has been explicitly marked deprecated here
_Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s)
^
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include\vcruntime.h(309,55): note: expanded from macro
'_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include\vcruntime.h(299,47): note: expanded from macro
'_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/src/demo.cpp(85,11): warning: 'getenv' is deprecated: This function or
variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
[-Wdeprecated-declarations]
if (getenv("MAGICK_FONT") != 0)
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdlib.h(1190,20): note: 'getenv' has been explicitly marked deprecated here
_Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s)
^
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include\vcruntime.h(309,55): note: expanded from macro
'_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include\vcruntime.h(299,47): note: expanded from macro
'_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
C:/Users/dan9e/Desktop/cartogrtist/ImageMagick-Windows/ImageMagick/Magick++/demo/demo/src/demo.cpp(86,29): warning: 'getenv' is deprecated: This function or
variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
[-Wdeprecated-declarations]
example.font(string(getenv("MAGICK_FONT")));
^
C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt\stdlib.h(1190,20): note: 'getenv' has been explicitly marked deprecated here
_Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s)
^
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include\vcruntime.h(309,55): note: expanded from macro
'_CRT_INSECURE_DEPRECATE'
#define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \
^
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.23.28105\include\vcruntime.h(299,47): note: expanded from macro
'_CRT_DEPRECATE_TEXT'
#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text))
^
6 warnings generated.
About the variable redefinitions, you might remember I've set those in my CMakeLists.txt:
dan9er wrote: ↑2019-10-06T18:59:42-07:00
Code: Select all
# set some stuff for Magick++ so it doesn't yell warnings at us
add_compile_definitions(MAGICKCORE_HDRI_ENABLE=0 MAGICKCORE_QUANTUM_DEPTH=8)
I don't know why IM is overriding them. Is this a Windows quirk?
I think the getenv stuff is the demo program's fault though. It should probably be changed to _dupenv_s...
Yet another issue is that the linker, well,
pukes at me about unresolved external symbols. However, I'm getting a similar issue to that on my Linux machine as well so I'll leave it to it's own thread.