www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - linking error

reply Andrey <andrey kabylin.ru> writes:
Hello, I'm trying to expose platform specific code to another 
file, I have platform.d with just interface e.g.:

 void platformShowSystemCursor();
 void platformHideSystemCursor();
 void platformSetMousePosition(void* window, in int x, in int y);

and I created another one - platform_sdl.d with particular implementation of these functions. But it doesn't work and I get linking errors: such as
8A744FAA3314/sim.o: in function >
/home/andrey/Projects/rpui/src/rpui/application.d:45: undefined reference to > `_D4rpui8platform25platformGapiDeleteContextFPvZv' How can I resolve it?
Jul 02
parent Andrey <andrey kabylin.ru> writes:
Ok, I have made it work, it's because of name mangling, I've just 
added extern(C).
Jul 02