Re: RegisterStaticModules depreciated -> how to register formats now?

Pro Turm <[email protected]> Tue, 11 Feb 2020 15:18:41 +0100 (CET)
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
With that I mean, that I cannot call OpenModule() from within a C++ class (calling a static extern c function is not C++ language supported).

You suggestion of using GetMagickInfo would also not work, since it contains #if defined(SupportMagickModules), which is  only defined for 
#if defined(HasLTDL)
#  define SupportMagickModules
#elif !defined(__MINGW32__) && !defined(__MINGW64__)
#  if defined(MSWINDOWS) && defined(_DLL)
#    define SupportMagickModules
#  endif
#endif

i.e. is NOT for static linking ...

So, the question would be stated like this: could you please provide an example of calling the OpenModule() or similar, which registerPNGformat-s with static linking?


On Mon, 10 Feb 2020, Pro Turm wrote:

> How do you combine calling the static calls like OpenModule() from a C++ class?

I am not totally sure what you are asking, but your C++ module would 
need to provide C linkage (extern C) for its register/unregister 
functions.

If C++ code is used, then the program should be linked using the C++ 
compiler to assure the correct run-time initialization of the whole 
program.

Bob
-- 
Bob Friesenhahn
bfriesen@..., http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
Public Key,     http://www.simplesystems.org/users/bfriesen/public-key.txt