[osg-users] Emscripten build and dlopen

Jay Maloney jnmaloney at gmail.com
Thu Nov 1 23:54:25 PDT 2018


I am using the Emscripten build of osg and am running into a problem when I try to use functions like 
Code:
osgDB::readNodeFile

 and 
Code:
osgDB::readImageFile

.

Usually I get an exception with the message

> To use dlopen, you need to use Emscripten's linking support, see (cannot post links) github ... /kripken/emscripten/wiki/Linking
> 


The instructions on the page say

> you must load the side module into the filesystem, so that dlopen (or fopen, etc.) can access it.


Currently I have in CMakeLists.txt  

Code:
TARGET_LINK_LIBRARIES(
    main
    osgViewer
    osgDB
    # osgDB plugins start.
    osgdb_osg
    osgdb_glsl
    osgdb_tga
    osgdb_serializers_osg
    osgdb_serializers_osgtext
    # osgDB plugins end.
    osgGA
    osgText
    osgUtil
    osg
    osgShadow
    OpenThreads
)



So, does anyone know what is supposed to be done here? I am able to load .osgt and .osgb nodes but can't load other file nodes or image files like png or tga. 

Do you have to actually do the loading of the side module, if so which file? The osglib*.a plugins?

Is there a way to load files without dlopen?[/code]

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







More information about the osg-users mailing list