라벨이 dll인 게시물 표시

OS/2 codes: compiler keywords exporting a symbol from a DLL without .def

The most basic way to export a symbol from a DLL is to list entries below EXPORTS keyword in .DEF file. However, this works for Visual Age C++(VAC) and gcc, but not for Open Watcom C/C++(OW). OW uses its own linker script, .lnk file, and EXPORT keyword not EXPORTS. Because of this, if you want to write DLLs buildable by the above three compilers, you should maintain at least two files of .def for VAC and gcc, and .lnk for OW. This increases the complexity of maintence. As well as, whenever symbols are exported newly, they should be added to .def and .lnk themselves. This is very annoying. Instead, it would be very convenient if exporting symbols in the source itself. All three compilers provide keywords for this. 1. Visual Age C++ VAC provides _Export keyword and #pragma export directive. Especially, _Export may be used in in-line style. For example, void _Export dll_entry( void ); will export dll_entry() as a proper name according to its calling convention and linkage ...

Porting to OS/2: Case #3 libtool and DLLs

libtool is a part of autotools to create shared libraries in an unified way on various platforms. Unfortunately, however, libtool lacks OS/2 support. So patches for this are provided separately. To use this patched libtool, you should regenerate your build system with autoreconf. Then libtool works well on OS/2 as expected. By the way, this is not enough. Unlike Unix-like systems, OS/2 does not allow to create DLLs which have undefined symbols. This is possible to static libs. But DLLs have to have all the symbols like the executables. For this, libtool requires some flags. That is, -no-undefined. Without this flag, libtool complains about that, and creates static libs instead of DLLs. For examples, if removing -no-undefined from linker flags of FLAC, the following message is printed. Colored By Color Scripter ™ 1 2   CCLD     libFLAC.la libtool: link: warning: undefined symbols not allowed in i...

Porting to OS/2: First port #3 make DLLs

When building FLAC, you can see the following message. Colored By Color Scripter ™ 1 2 3 4 5 6 7 8 9 10 11 12   CCLD   libFLAC.la *** Warning: inter-library dependencies are not known to be supported. *** All declared inter-library dependencies are being dropped. *** The inter-library dependencies that have been dropped here will be *** automatically added whenever a program is linked with  this  library *** or is declared to -dlopen it. *** Since  this  library must not contain undefined symbols, *** because either the platform does not support them or *** it was explicitly requested with -no-undefined, ***...