Perhaps this is the work of linkers, not compilers. When linking this as a program (.exe), the linker will only take care of importing the corresponding characters, and when linking the DLL, the __dllexport mechanism is probably what you are looking for, or some ld flags can help you (LD person).
source share