Re: [osg-users] [osgPlugins] Very confused about plugins

2014-07-18 Thread Bram Vaessen
Thanks Robertos and Farshid.

Robertos, when I said: What are the steps that are involved in building the 
libraries, and loading them as plugins? 

I actually meant to ask this from the perspective of the 'system', and not the 
steps that a user has to take to make it work. This demonstrates what I mean 
very nicely though: most of the documentation involves a set of steps that you 
have to take. Not that tutorials are a bad thing, obviously this is exactly 
what most new users are looking for... but still it doesn't explain  what is 
happening exactly happening in those steps, and if any of the steps fails (or 
even worse, you'll get an error at the end and you don't really know which step 
failed), you are stuck to asking other experts or trying random things :)



 The OSG will search for osgPlugins-version/osgdb_extension.dll/.so directory 
 first by default to avoid issues with different versions of the OSG/plugins 
 being binary incompatible (and issue known widely in the compute industry as 
 DLL hell.)  For this reason you should set the library path to the parent 
 directory where the osgPlugins-version directory rather than to the directory 
 itself, otherwise you could end up finding plugins for a different version of 
 the OSG. 


This is more the kind of information I was hoping to find, and the general note 
too, and the OSG_NOTIFY_LEVEL to DEBUG is also a very good tip, thanks!!!

Farshid: thanks it was indeed a problem with the dll's, I copied them all 
again, and there must have been an older version of soms png dll in my project 
probably, cause I only overwritten already existing files, but still it made a 
difference :)

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=60321#60321





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] Very confused about plugins

2014-07-17 Thread Robert Osfield
Hi Bram,




On 16 July 2014 19:58, Bram Vaessen bram.vaes...@gmail.com wrote:


 -What are the steps that are involved in building the libraries, and
 loading them as plugins?


Have look at the Getting started and Platform specifics documentation on
the website:

   www.openscenegraph.org/index.php/documentation/getting-started
   www.openscenegraph.org/index.php/documentation/platform-specifics

The books will also provide guidance.

You should just need to provide the 3rd party dependencies and make sure
that CMake finds them OK and then build the OSG.

Loading wise you need to make sure either the PATH or OSG_LIBRARY_PATH env
var points to the parent directory of the osgPlugins-version directory that
you have built or installed. The OSG will then at runtime search for the
plugins and load them dynamically.

To see where the OSG is searrching for the plugins enable verbose debug out
by settings the env var OSG_NOTIFY_LEVEL to DEBUG and then look at the
console output, this will list what plugins it's trying to load and what
files it's trying to load.

The env var OSG_FILE_PATH is used to guide the searching of files.

You can also set the library and file search paths programatically via
osgDB::setDataFilePathList(..) and setLibraryFilePathList(..). See the
include osgDB/FileUtils.


-In each of these steps what files are supposed to be created and how can
 you check if that happened etc.?


All the plugins will be built as .dll's under windows and .so's under other
platforms and will be placed in a osgPlugins-version directory.  The OSG
will search for osgPlugins-version/osgdb_extension.dll/.so directory first
by default to avoid issues with different versions of the OSG/plugins being
binary incompatible (and issue known widely in the compute industry as DLL
hell.)  For this reason you should set the library path to the parent
directory where the osgPlugins-version directory rather than to the
directory itself, otherwise you could end up finding plugins for a
different version of the OSG.


 -how can you get more error information from the failing the loading of
 the plugin?


setting the OSG_NOTIFY_LEVEL to DEBUG will tell the OSG to output lots of
info to console, search through this to find references to the file loading.

--

As a general note, the OSG plugin system uses the Chain of Responsibility
Design Pattern, this scheme means that it tries all loaded plugins to see
if they can load a file before checking the file system for plugins that
may be able to load the plugin.  This scheme means that you can provide a
single plugin to load multiple formats, such as used in the Quicktime
plugin.  Another aspect to the scheme is that finding and loading of files
is deferred to the plugins, something that is important when handling files
accessed by http etc.  This loose coupling is very powerful, but it does
mean there isn't always 1:1 mapping between a file format extension and a
plugin, which is part of the reason why the OSG error reporting system
can't always be specific about what error there might be.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] [osgPlugins] Very confused about plugins

2014-07-16 Thread Bram Vaessen
Hi,

I'm having issues with loading png. It just says: Warning: Could not find 
plugin to read objects from file GUI/canvas.png.

The same line replaced with .jpg works fine. I built OSG 3.2 from source some 
time ago (using some tutorial, and CMake and such), and I recall that I tried 
to enable both jpg and png. Somehow png doesn't work.

Now the real problem is: I have absolutely no clue to how this whole build 
system and plugin system works, and I can't seem to find decent information on 
it... only this: 
http://trac.openscenegraph.org/projects/osg//wiki/Support/UserGuides/Plugins

also: when I try to load a non-existing file as an image, I get the exact same 
error. There is no way for a 'noob' like me (at least a noob in building 
systems) to understand or find out what the problem is. It looks like there is 
a libpng13d.lib in the lib dir, and I found a osgdb_png.dll and osgdb_png.dll 
somewhere that I copied to my projects working directory, but that doesn't seem 
to be enough...

Honestly, I'm desperately confused. I have to admit that I just don't know that 
much about cmake, libraries and dll's etc. just know the basics, but there's a 
huge information gap between some very general information that you can find on 
cmake and osg plugins, and how the actual build system works in reality. There 
also doesn't seem info on how you can track down errors like plugins that are 
not loading. I also looked on the forums and there are some general tips like: 
you have to rebuild the png library... but then I'm like... ok ... how??? is 
that part of the osg source? I have no clue how to do this :(

I know that with some random hints from users I may be able to fix this one 
problem this time, but then again I still wouldn't know what happened or how to 
fix the next problem with plugins.

Isn't there more information on this? Or can someone explain it here how it all 
works?

Like:

-What are the steps that are involved in building the libraries, and loading 
them as plugins?
-In each of these steps what files are supposed to be created and how can you 
check if that happened etc.?
-how can you get more error information from the failing the loading of the 
plugin?

I would be very very grateful for any information!

Thank you!

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=60302#60302





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] [osgPlugins] Very confused about plugins

2014-07-16 Thread Farshid Lashkari
Hi Bram,

First off, I feel your pain.

Is osgdb_png.dll in your osgPlugins-XXX subfolder? If so, then the DLL
might be dynamically linking to the libpng library, instead of statically
linking. If this is the case, then you will need to place the
libpng13.dll file in your application folder (next to your exe).

When dealing with DLL issues like this, I find the Dependency Walker (
http://www.dependencywalker.com/) application invaluable. Opening an
exe/dll file in the application will list all its DLL dependencies and let
you know which ones are missing or failed to load.

Regarding the error message, I agree that they could be a little more
clear. The error message does not distinguish between failing to find the
DLL vs failing to load the DLL.

Cheers,
Farshid


On Wed, Jul 16, 2014 at 11:58 AM, Bram Vaessen bram.vaes...@gmail.com
wrote:

 Hi,

 I'm having issues with loading png. It just says: Warning: Could not find
 plugin to read objects from file GUI/canvas.png.

 The same line replaced with .jpg works fine. I built OSG 3.2 from source
 some time ago (using some tutorial, and CMake and such), and I recall that
 I tried to enable both jpg and png. Somehow png doesn't work.

 Now the real problem is: I have absolutely no clue to how this whole build
 system and plugin system works, and I can't seem to find decent information
 on it... only this:
 http://trac.openscenegraph.org/projects/osg//wiki/Support/UserGuides/Plugins

 also: when I try to load a non-existing file as an image, I get the exact
 same error. There is no way for a 'noob' like me (at least a noob in
 building systems) to understand or find out what the problem is. It looks
 like there is a libpng13d.lib in the lib dir, and I found a osgdb_png.dll
 and osgdb_png.dll somewhere that I copied to my projects working directory,
 but that doesn't seem to be enough...

 Honestly, I'm desperately confused. I have to admit that I just don't know
 that much about cmake, libraries and dll's etc. just know the basics, but
 there's a huge information gap between some very general information that
 you can find on cmake and osg plugins, and how the actual build system
 works in reality. There also doesn't seem info on how you can track down
 errors like plugins that are not loading. I also looked on the forums and
 there are some general tips like: you have to rebuild the png library...
 but then I'm like... ok ... how??? is that part of the osg source? I have
 no clue how to do this :(

 I know that with some random hints from users I may be able to fix this
 one problem this time, but then again I still wouldn't know what happened
 or how to fix the next problem with plugins.

 Isn't there more information on this? Or can someone explain it here how
 it all works?

 Like:

 -What are the steps that are involved in building the libraries, and
 loading them as plugins?
 -In each of these steps what files are supposed to be created and how can
 you check if that happened etc.?
 -how can you get more error information from the failing the loading of
 the plugin?

 I would be very very grateful for any information!

 Thank you!

 --
 Read this topic online here:
 http://forum.openscenegraph.org/viewtopic.php?p=60302#60302





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org