To import or export a symbol when the source code cannot be updated with a __declspec() annotation, the following linker options can be used:
This option adds symbol to the dynamic symbol table as an imported reference. At link-time, the static linker searches through any object libraries that are included in the link to make sure that a definition of symbol is available.
If a definition of symbol is included in the current link, then the --import option is ignored with a warning.
This option adds symbol to the dynamic symbol table as an exported definition. At link-time, if the are any objects that contain an unresolved external reference to symbol when the object that exports symbol is encountered, then the object that contains the exported definition is included in the link.
If the --export=symbol option is used on the compile of an object that does not have a definition of symbol in it, then the compiler generates an error.
NOTE
The --import and --export OptionsThe --import and --export options cannot be used when building a Linux executable or DSO.