Menu ▾ ▴

#782 configure + MSVC /MD build registers no coders: studio.h enables SupportMagickModules for any `_DLL` build

v1.0_(example)
closed-fixed
None
5
2026-11-04
2026-11-03
No

Seen with GraphicsMagick 1.3.49 (and 1.3.45), building with configure and MSVC cl through vcpkg (x64-windows, dynamic CRT), with --with-modules=no.

magick/studio.h decides whether coders are loadable modules:

#if defined(HasLTDL)
#  define SupportMagickModules
#elif !defined(__MINGW32__) && !defined(__MINGW64__)
#  if defined(MSWINDOWS) && defined(_DLL)
#    define SupportMagickModules
#  endif
#endif

MSVC predefines _DLL for every /MD or /MDd compile, so a configure build with the dynamic CRT also ends up with SupportMagickModules defined. static.c then compiles out RegisterStaticModules(). The coders are linked into libGraphicsMagick, but no modules are built or installed, so none of them get registered. At runtime gm convert -list format prints nothing, and every read or write fails with "No encode delegate for this image format".

This branch is presumably meant for the VisualMagick DLL build, whose generated projects define _VISUALC_. Requiring that macro fixes the configure build and leaves VisualMagick unchanged:

-#  if defined(MSWINDOWS) && defined(_DLL)
+#  if defined(MSWINDOWS) && defined(_DLL) && defined(_VISUALC_)

With this change, the x64-windows build round-trips PNG, WebP, JPEG, TIFF and GIF through Magick++. Static-CRT (/MT) builds are unaffected, since _DLL isn't defined there.

Discussion

  • Bob Friesenhahn

    Bob Friesenhahn - 2026-11-04
    • Description has changed:

    Diff:

    
    
    • status: --> open
    • assigned_to: Bob Friesenhahn
    • Group: --> v1.0_(example)
    • Priority: --> 5
     
  • Bob Friesenhahn

    Bob Friesenhahn - 2026-11-04

    This issue is addressed by Mercurial changeset 18234:40e85cb59a50. Thank you for the bug report and the proposed fix.

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2026-11-04
    • status: open --> closed-fixed
     

Log in to post a comment.