C++ Function:
bool cppFunc( float[3] color );

D binding:
extern(C++) bool cppFunc( float[3] color );

Using with:
float[3] my_color;
cppFunc( my_color );

-> Error: Internal Compiler Error: unable to pass static array to extern(C++) function.
Error: Use pointer instead.


Using with:
cppFunc( my_color.ptr );

-> Error: function cppFunc( float[3] color ) is not callable using argument types (float*)


Altering D binding:
extern(C++) bool cppFunc( float* color );

Using with:
cppFunc( my_color.ptr );

-> error LNK2001: unresolved external symbol "bool __cdecl cppFunc(float *)" Binding.exe : fatal error LNK1120: 1 unresolved externals
Error: linker exited with status 1120
dmd failed with exit code 1120.


So what next? How can I interface to the cpp function?

Reply via email to