Re: Compiling from source on Windows fails to find DLLs

Casper Gripenberg <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.help
Message-ID <[email protected]>
Thanks Bob,

I think it must have modified the registry entries, because I
could not find any ENV variables defined related to this.

However on my GM source compilation UseInstalledMagick is not
defined.

The solution was to roll up my sleeves and read the code,
where I found the ENV vars MAGICK_CODER/FILTER_MODULE_PATH.

Setting those to the GM source bin folder solved the issue.

But now my next questions become:

1) What if I want to distribute my app with GM included, and
the user has their own IM or GM installation and/or apps using
IM or GM. How do I ensure my app only loads the libraries that
I provide with my app, and not the libs from any other distribution?

Is there some way to programmatically force the GM library
to only initialize from the path I give it? Setting ENV vars
seems slightly unreliable, or what do you think? Is there a
better solution?

For example the docs seem to indicate that InitializeMagick()
somehow uses the provided path for lookups, but from my
experimentation it does not appear to do that.

2) What is another app is loaded in memory with the GM DLLs
already active. Will that interfere with my app if I try and
load DLLs with the same names, but most likely different versions?

Thanks.

Casper

On 22.10.2017 17:14, Bob Friesenhahn wrote:
> I would guess that "File Viewer Lite" is partially based on
> GraphicsMagick and so it has provided its own GraphicsMagick
> installation, perhaps updating the Windows search path and setting the
> Windows registery entries documented in the "INSTALL-windows.html"
> text.  It might also have set other environment variables system-wide.
> These are causing your GraphicsMagick build to try to use the modules
> installed by "File Viewer Lite".
>
>> I also tried setting MAGICK_HOME, but to no avail :(
>>
>> What's going on? Why can't GraphicsMagick find its own DLLs,
>> even though they are all right there in the bin folder?
>
> This does seem annoying.  The most powerful setting is
> 'UseInstalledMagick' in magick_config.h.  Normally this should be left
> undefined.  If you have defined it, then correct operation is not
> assured unless the software has been "installed" using Windows registery
> entries.
>
> Bob

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.