The webidl test in the suite checks for this, it has

enum EnumClass_EnumWithinClass {
  "EnumClass::e_val"
};

I don't see what the crucial difference is between your testcase and that.
Perhaps try to "bisect" between them, making the test case more and more
similar to yours, until it is identical, and see where it breaks along the
way.


On Wed, Jul 8, 2015 at 2:16 AM, Christian Miller <[email protected]>
wrote:

> Hello,
>
> I have problems to compile the following C++ class with an internal enum
> definition:
>
> *foo.h:*
>
> class Foo {
> public:
>   Foo();
>
>   enum Bar {
>     Bar1 = 1,
>     Bar2 = 2
>   };
>
>   Bar getBar(  ){ return Bar1; };
> };
>
> *foo.cpp:*
>
> #include <stdio.h>
> #include "foo.h"
>
> Foo::Foo()
> {
>     printf("Constructor of Foo\n");
> }
>
> #include "glue.cpp"
>
> *foo.idl:*
>
> enum Foo_Bar {
>   "Foo::Bar1",
>   "Foo::Bar2"
> };
>
> interface Foo {
>   void Foo();
>   Foo_Bar getBar();
> };
>
> *build flow:*
>
> python ${EMSCRIPTEN}/tools/webidl_binder.py foo.idl glue
> emcc foo.cpp --post-js glue.js -o foo.js --memory-init-file 0
>
> *emcc -v:*
>
> emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld)
> 1.34.1
> clang version 3.7.0 (https://github.com/kripken/emscripten-fastcomp-clang/
> d0bf104be3b7fb821711438ab9a26dabc3bc6cd9) (
> https://github.com/kripken/emscripten-fastcomp/
> 6ce52965507b262417a7e815fd46e8e92f351b12)
> Target: x86_64-unknown-linux-gnu
> Thread model: posix
> Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8
> Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.8.4
> Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9
> Found candidate GCC installation: /usr/lib/gcc/i686-linux-gnu/4.9.1
> Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
> Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8.4
> Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9
> Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.9.1
> Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/4.8
> Candidate multilib: .;@m64
> Selected multilib: .;@m64
> INFO     root: (Emscripten: Running sanity checks)
>
> *error:*
>
> In file included from foo.cpp:10:
> ./glue.cpp:27:1: error: unknown type name 'Foo_Bar'
> Foo_Bar EMSCRIPTEN_KEEPALIVE emscripten_bind_Foo_getBar_0(Foo* self) {
> ^
> ./glue.cpp:27:9: error: expected unqualified-id
> Foo_Bar EMSCRIPTEN_KEEPALIVE emscripten_bind_Foo_getBar_0(Foo* self) {
>         ^
> /opt/emsdk/emscripten/incoming/system/include/emscripten/emscripten.h:60:30:
> note:
>       expanded from macro 'EMSCRIPTEN_KEEPALIVE'
> #define EMSCRIPTEN_KEEPALIVE __attribute__((used))
>                              ^
> In file included from foo.cpp:10:
> ./glue.cpp:36:1: error: unknown type name 'Foo_Bar'
> Foo_Bar EMSCRIPTEN_KEEPALIVE emscripten_enum_Foo_Bar_Bar1() {
> ^
> ./glue.cpp:36:9: error: expected unqualified-id
> Foo_Bar EMSCRIPTEN_KEEPALIVE emscripten_enum_Foo_Bar_Bar1() {
>         ^
> /opt/emsdk/emscripten/incoming/system/include/emscripten/emscripten.h:60:30:
> note:
>       expanded from macro 'EMSCRIPTEN_KEEPALIVE'
> #define EMSCRIPTEN_KEEPALIVE __attribute__((used))
>                              ^
> In file included from foo.cpp:10:
> ./glue.cpp:39:1: error: unknown type name 'Foo_Bar'
> Foo_Bar EMSCRIPTEN_KEEPALIVE emscripten_enum_Foo_Bar_Bar2() {
> ^
> ./glue.cpp:39:9: error: expected unqualified-id
> Foo_Bar EMSCRIPTEN_KEEPALIVE emscripten_enum_Foo_Bar_Bar2() {
>         ^
> /opt/emsdk/emscripten/incoming/system/include/emscripten/emscripten.h:60:30:
> note:
>       expanded from macro 'EMSCRIPTEN_KEEPALIVE'
> #define EMSCRIPTEN_KEEPALIVE __attribute__((used))
>                              ^
> 6 errors generated.
> ERROR    root: compiler frontend failed to generate LLVM bitcode, halting
>
>
> Any idea what I am doing wrong? Thanks for your help!
>
> Christian
>
> --
> 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.
>

-- 
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