[osg-users] Build Error on Windows

Philip Lowman philip at yhbt.com
Mon Mar 23 20:24:31 PDT 2009

On Mon, Mar 23, 2009 at 5:47 PM, Mark Sciabica <msciabica at itracs.com> wrote:

> Hi Robert,
> Sorry, I thought it would have been clear from my first e-mail. I'll try
> again.
> FileUtils.cpp in osgDB has this code.
> static void appendInstallationLibraryFilePaths(osgDB::FilePathList&
> filepath)
> {
>   // Append the install prefix path to the library search path if
> configured
>   filepath.push_back(ADDQUOTES(OSG_DEFAULT_LIBRARY_PATH));
> #endif
> }
> osgDB's CMakeLists.txt has this line:
> This means that the install path configured at build time will be searched
> for plugins. This does not make sense for prebuilt  binaries because the
> install location will likely be different on different machines. I propose
> removing the function appendInstallationLibraryFilePaths, and also the line
> in CMakeLists since it is only this function that makes use of it.

This is kinda dangerous too.  What happens if:

1. User installs OSG 2.6 to /usr/local/OSG
2. User is happy
3. One day user decides to download OSG 2.8
4. User decides to move /usr/local/OSG => /usr/local/OSG-2.6
5. User compiles OSG 2.8 and installs to /usr/local/OSG again
6. User is happy but if they go to run their old OSG 2.6 build what
happens?  My guess is that OSG 2.8 libraries are found.

What is ${LIB_POSTFIX} above.  Is this supposed to be to facilitate debug

Is it possible to somehow find the location of "osgDB.dll" or "libosgDB.so"
within code as a way to solve the plugin loading problem.  Then you could
simply append "path_to_libosgDB.so + ../lib${LIB_POSTFIX}/${OSG_PLUGINS}" to
the search path.  I know you can do this with the binary that's being run
(if osgviewer is used for example).  This wouldn't work for people running
an OSG app in a different path that uses libosgDB however.

Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20090323/f8e3291e/attachment-0003.htm>

More information about the osg-users mailing list