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

Jean-Sébastien Guay jean-sebastien.guay at polymtl.ca
Fri Aug 24 07:04:23 PDT 2007


Hello Luigi,

> 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>;

The patch implements (rather enforces) the Win32 search order, as  
specified in the page linked many times in this thread:  
http://msdn2.microsoft.com/en-us/library/ms682586.aspx

I believe this is the desired order to be consistent with the  
platform's specification. If you want to override this, you can use  
the OSG_LIBRARY_PATH environment variable, which will be put before  
any platform-specific paths. It will in effect be searched first.

I don't think any solution can be ideal for everyone. Someone will  
always want a different behaviour. The important thing is that the  
default is sensible, and there are ways to override the default if you  
want to. That is the solution we have now, IMHO.

> 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

Though I do not do things like that, I don't think this patch will  
change anything for most users, so it should be OK. Robert, can you  
apply it?

Thanks for testing!

J-S
-- 
______________________________________________________
Jean-Sebastien Guay     jean-sebastien.guay at polymtl.ca
                         http://whitestar02.webhop.org/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.




More information about the osg-submissions mailing list