Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADSupport does not generate correct static mingw libs for GraphicsMagick #18

Open
Engbretson opened this issue Apr 18, 2018 · 0 comments

Comments

@Engbretson
Copy link

If one wishes to use the NDFileMagick plugin with at least mingw x64, certain library references are unresolved.
/mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x2a1): undefined reference to __imp__ZN6Magick5ImageC1Ev' /mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x3ba): undefined reference to __imp__ZN6Magick5Image4typeEN9MagickLib9ImageTypeE'
/mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x3ed): undefined reference to __imp__ZN6Magick5Image4readEjjRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEN9MagickLib11StorageTypeEPKv' /mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x405): undefined reference to __imp__ZN6Magick5Image7channelEN9MagickLib11ChannelTypeE'
/mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x412): undefined reference to __imp__ZN6Magick5Image7qualityEj' /mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x41f): undefined reference to __imp__ZN6Magick5Image5depthEj'
/mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x42a): undefined reference to __imp__ZN6Magick5Image12compressTypeEN9MagickLib15CompressionTypeE' /mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x48c): undefined reference to __imp__ZN6Magick5Image5writeERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
/mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x4ad): undefined reference to __imp__ZN6Magick5ImageD1Ev' /mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x5d1): undefined reference to __imp__ZN6Magick5ImageD1Ev'
/mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x726): undefined reference to __imp__ZN6Magick5ImageC1Ev' /mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x7a1): undefined reference to __imp__ZN6Magick16InitializeMagickEPKc'
/mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text+0x7fc): undefined reference to __imp__ZN6Magick5ImageD1Ev' /mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text$_ZN12NDFileMagickD1Ev[_ZN12NDFileMagickD1Ev]+0x2e): undefined reference to __imp__ZN6Magick5ImageD1Ev'
/mnt/c/epics71/areaDetector-3-2/ADCore-3-2/lib/windows-x64-mingw/NDPlugin.lib(NDFileMagick.o):NDFileMagick.cpp:(.text$_ZN12NDFileMagickD0Ev[_ZN12NDFileMagickD0Ev]+0x2e): undefined reference to `__imp__ZN6Magick5ImageD1Ev'
collect2: error: ld returned 1 exit status
This is due to the include.h file in the Magick++ directory being

#if (defined(WIN32) || defined(WIN64)) && !defined (CYGWIN) //&& !defined(MINGW32)

So by default all flavors of mingw get

MagickDLLDecl __declspec(dllexport)

Even when your building static libraries

Making this change seems to work for me, but only tested with the x64 version of mingw

#if (defined(WIN32) || defined(WIN64)) && !defined (CYGWIN) && !defined(MINGW32) && !defined(MINGW64)

Not tested to see what happens if shared libraries are actually required,

sudilav added a commit to sudilav/ADSupport that referenced this issue Jul 20, 2021
untested on share libraries thus far
bsobhani pushed a commit to bsobhani/ADSupport that referenced this issue Apr 1, 2024
untested on share libraries thus far
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant