[osg-submissions] Plugin DLL search order fix for Win32

Robert Osfield robert.osfield at gmail.com
Fri Aug 24 01:30:27 PDT 2007


Hi Luigi,

On 8/24/07, Luigi Calori <l.calori at cineca.it> wrote:
> 1)
>  it is designed to search anyway for system and current directory before
> PATH defined folders: this prevet an application writer to
> set PATH env var to override presence of system installed  plugins.
> Would not be better to reverse the order?
> like
> <application_folder>/osgPlugins<osgversion> ;
> <PATH_folder>/osgPlugins<osgversion>; .....
> <PATH_folder>/osgPlugins<osgversion>;<SYSTEM_folder>/osgPlugins<osgversion>;<CurrDir_folder>/osgPlugins<osgversion>;

It'd be worth posting this suggestion to osg-users for general
discussion.  For a point of reference, I believe J-S implemented the
spec according to Microsoft docs of lib search paths, the new code in
FileUtils.cpp documents this well.

> 2)
> in VisualStudio builds, the projects appends /Debug or /Release to the
> folders where dll are created at build time,
>  I was used to test osg build BEFORE installing by setting up PATH
> environment to build folders.
> With current enforced versioned plugin this is impossible as projects
> place plugin dll in lib/osgPlugins<osgversion>/<Debug or Release>
>  I attach a patch that change the build folder placement to lib/<Debug
> or Release>/osgPlugins<osgversion>
> that seems also more consistent.
> The patch should not affect other platform builds

Before I go ahead and merge, could you say how the rest of the libs
are distributed?

I do wonder if it wouldn't be possible to build both the release and
debug plugins into the same directory as the debug plugins all have a
d postfix so there won't be any overlap.

Also is there any way to get the plugins directory to go into the bin
directory under Windows/MSVC?  I presume CMake adds the lib
automatically.  Is there any way such as using ../bin/ preprending the
target to fool it in doing what we want?

My hope would be that we can build libs and bins all in roughly the
right place, without needing to install.

Robert.


More information about the osg-submissions mailing list