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

Robert Osfield robert.osfield at gmail.com
Fri Aug 24 02:44:17 PDT 2007


Hi Luigi,

On 8/24/07, Luigi Calori <l.calori at cineca.it> wrote:
> lib/<Debug>/osgd.dll
> lib/<Debug>/osgViewerd.dll
> ....
> lib/osgPlugins<osgversion>/osgdb_osgd.dll
> lib/osgPlugins<osgversion>/osgdb_ived.dll
> ....

Is this before or after your change?

> I' ll try a hack that have been suggestd on CMake user list to do that,
> prepending ../Debug to target name, using ../ is not considered the
> cleanest solution,thoug.
> If you think it would be viable, I can try to se if it works.

A few inelegant edges to the internals of the build are worth making
the final positioning of lib, plugins and bins in a what they is
easier to get things working out of the box.

> >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?
> >
> >
> >
> I already tested it, it can be easily done, the only problem is name
> clashing pr .pdb files that VS produce:
> osviewer is both a library (.dll and .lib) as well as an executable
> (.exe) the corresponding .pdb file (debug info for VisualStudio) have
> the same name osgviewer.pdb for both the application as the library
> The sam happen for osgtext and osgmanipulator
> In order to properly build debug under the same bin folder is required
> to resolve the clashing. my solution was to append _exe to the .exe
> names (like osgviewer.exe --> osgviewer_exe.exe)
> I agree having windows build stuff all in the same bin folder   would
> help running  "out of the box" without adding lib/Debug to PATH and
> without installing

Curse windows lack of case sensitivity....

Renaming executables is not so good as all the docs talk about
osgviewer, we really want all platforms apps called the same thing and
have as few exceptions as possible.

I guess another crude mod might be to name the core libraries libosg,
libosgViewer, libosgText etc.  This is how unices do the naming, with
the lib appear implicitly, and windows doesn't do this, or require it,
and its not the windows convention, but perhaps its something that
could help.  This would require lots of users to change their builds
to handle the new naming though...

> >My hope would be that we can build libs and bins all in roughly the
> >right place, without needing to install.
> >
> >
> If the design seems you to fit, let me know, I can try to test the
> "one-folder" build layout.

I'm a bit lots of the design right now... so I'm not sure what to give
the thumbs up to..

>From my Windows nieve point of view I was thinking that we might be
able to have on build


  lib/

      contains all the libs, debug and release in the same direcgory, d appended
      to the debug libs to differentiate them

  bin/

     contains executables and dll's.

  bin/osgPlugins-version/

      contains all the debug and release in the same directory

This would then mirror the structure one would expect on install.
Ideally I'd like it so users don't have to play too many games with
paths to get things to work.

Would this be possible?  From your email it sounds like name
collisions will be one of the biggest hurdles.

Robert.


More information about the osg-submissions mailing list