Hi Guys,

I've been struggling with an issue with embind.  I have a media player that 
I am building with emscripten.  Ultimately I need this to run as WASM, but 
I need pthreads.  While I've been waiting for pthread support in WASM, I've 
been building to asm.js and debugging.  Everything seems to be working, 
although the performance isn't great but that was expected.

I'm getting to the point now where I want to test out WASM.  I am using the 
incoming branch of emscripten and the firefox nightly build.  However, when 
I use -s WASM=1 I get 

uncaught exception: BindingError: Cannot register public name '' twice

The call stack looks like this:

throwBindingError <- exposePublicSymbol <- __embind_register_enum

So it looks like it trying to setup the binding for one of my enums.  I 
have a few enums.  The name of the enum is blank (""), so I can't tell 
which one it's crapping out on.  But it bothers me that embind doesn't have 
a problem when I compile to .js. 

My enum definitions look like this: 

   enum MediaPlayerState {
        PlayerStateStopped                                  =0,
        PlayerStateReadyToPlay                              =1,
        PlayerStateEndSeeking                               =2,
        PlayerStateEndOfMovie                               =3,
        PlayerStateBufferEmpty                              =4,
        PlayerStateBufferReady                              =5,
        PlayerStateLanguageChanged                          =6,
        PlayerStateError                                    =0xFFFFFFFF, 
    };
    
And the bindings look like this:

EMSCRIPTEN_BINDINGS(MediaPlayer) {

  using namespace emscripten;

  enum_<Arris::MediaPlayerState>("MediaPlayerState")
  .value("PlayerStateStopped",                                
 Arris::MediaPlayerState::PlayerStateStopped)
  .value("PlayerStateReadyToPlay",                            
 Arris::MediaPlayerState::PlayerStateReadyToPlay)
  .value("PlayerStateEndSeeking",                              
Arris::MediaPlayerState::PlayerStateEndSeeking)
  .value("PlayerStateEndOfMovie",                              
Arris::MediaPlayerState::PlayerStateEndOfMovie)
  .value("PlayerStateBufferEmpty",                            
 Arris::MediaPlayerState::PlayerStateBufferEmpty)

  .value("PlayerStateBufferReady",                            
 Arris::MediaPlayerState::PlayerStateBufferReady)
  .value("PlayerStateLanguageChanged",                        
 Arris::MediaPlayerState::PlayerStateLanguageChanged)
  .value("PlayerStateError",                                  
 Arris::MediaPlayerState::PlayerStateError)
  ;

It all seems pretty straight forward.  Does anybody have any ideas why 
building .wasm would cause this, or what my next steps debugging this 
should be?

Thanks in advance for any help!

Scott

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to