https://sourceware.org/bugzilla/show_bug.cgi?id=30140
--- Comment #3 from Pali Rohár <pali at kernel dot org> --- Thank you for information. I see that it is quite misleading because DEF file in some case is used for "dllimport" functionality and in some other cases is used for "dllexport" functionality. And this can be even more confusing when building DLL library because it can do both things: import external symbols and export its own symbols. Eric Botcazou: It is quite pity that this is not supported, because more or less DEF file is text description of the binary import library, which is used for indirect linking. Direct linking with DLL file is nice feature but unusable for Windows system libraries (as they are not re-distributable and hence not part of any toolchain). I see benefit of usage of text files compared to binary. But I understand that you do not want to support or implement another option for linking. In the example from the issue description, I invoked gcc for building PE executable (and not DLL library). And if DEF file passed to gcc specify "dllexport" stuff, meaning which functions will be exported from _currently building DLL library_ as specified in LIBRARY keyword in DEF file, then I have feeling that this combination of command line options passed to gcc does not make sense, and gcc or ld should throw compile or link error. For example: Error: Compiling executable (because -shared nor -dll was not passed to gcc) but passed DEF file contains LIBRARY keyword suitable when compiling DLL library. -- You are receiving this mail because: You are on the CC list for the bug.