Re: Compiling from source on Windows fails to find DLLs
Casper Gripenberg <[email protected]>
| Newsgroups | gmane.comp.video.graphicsmagick.help |
|---|---|
| Message-ID | <[email protected]> |
I finally figured out the problem. Too many moving parts, but I never thought to check the Windows environment variables BEFORE I went and modified them myself. Turns out File Viewer Lite had set both of the MAGICK_*_MODULE_PATH variables globally. Ddoouh! That thing is now gone from my computer, and as you can imagine, it was deleted accompanied by some select curse words. Everything now works as it should. I also checked with MAGICK_DEBUG, and it's loading everything directly from the exe folder, like it should. This also means no ugly hacks will be required when distributing that app either. Great..bliss in my brain again. Thanks for your help! Casper On 22.10.2017 22:21, Bob Friesenhahn wrote: > That is really ugly. > > The most essential thing is to put the executable for your app in the > same directory as all of the GM DLLs. Just about the only thing 100% > reliable with Windows search for DLLs is that it checks the directory in > which the using app resides in first. Otherwise, it does different > things with different Windows versions, and is likely to search the path > indicated by "PATH" (which the other app may have set!). > > It is supposed to do that if UseInstalledMagick is not defined. The > code supporting it is in InitializeMagickClientPathAndName() in > magick/magick.c. It is important to determine if the core DLL that you > built is indeed being executed, or if the one provided by the other > application is being executed. > > The path the user provides is less reliable than the path that the OS > itself provides to the core GM DLL. If GetExecutionPath() is being > invoked, then the search path is based on the DLL location. > > The DLLs are not like OLE DLLs in that they do not act as a server and > share state. There is total process isolation between apps using the > same DLLs. However, it is necessary that the correct DLLs are used. > > If you define the environment variable MAGICK_DEBUG: > > MAGICK_DEBUG=Configure > > and start your app with it set in its environment, then there will be > tracing of all of the configuration (perhaps to the Windows application > event log), including registry keys and directory search paths. > > Bob ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot