grasph / wrapit

Automatization of C++--Julia wrapper generation
MIT License
98 stars 12 forks source link

Globals in namespace do not work #38

Closed peremato closed 7 months ago

peremato commented 7 months ago

The following code

namespace NS {
  struct C {};
  extern C* global_var;
}

produces the following error when compiling the generated wrapper

libTestVarField/src/jlTestVarField.cxx:241:38: error: unknown type name 'C'; did you mean 'NS::C'?
    t.method("NS!global_var", []()-> C * { return NS::global_var; });
                                     ^
                                     NS::C
./A.h:33:10: note: 'NS::C' declared here
  struct C {};
         ^

I think is similar to the error in https://github.com/grasph/wrapit/issues/36#issuecomment-1819437160

grasph commented 7 months ago

Reopen the issue if above merge does not fix the issue.