Re: Creating and using a .DLL/.SO?

new topic     » goto parent     » topic index » view thread      » older message » newer message
jimcbrown said...

Both versions of the C source have it as _1hello. It is named _1hello in the translated C code regardless of platform.

The difference is, the Windows version writes out a .def file that exports _1hello as hello when we are compiling a dll. When compiling a shared object (.so) there is no exports file for Unix, so we are stuck with _1hello. This looks quite difficult to fix on the Unix side short of truly naming the object without the _1 prefix (but then doing this affects the Windows code).

See Write_def_file() in source/c_decl.e for the actual code.

There's also the issue of possibly conflicting names. And I believe that gcc prefixes an underscore (though maybe not in all situations). Perhaps the best thing to do is just to output the .e wrapper that handles the imports correctly. We could also do a regular C header (.h) fileprobably optional.

The wrapper could be possibly multiple files with a "lib" prefix. The multiple files would allow us to replicate the namespaces. Or we could change the default namespace to be changeable within a file.

Matt

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu