From: Brian D. <br...@de...> - 2007-10-01 03:10:37
|
"Emmanuel Stapf [ES]" wrote: > I have the following C declaration: > > __declspec(dllexport) void __stdcall my_func (int i) { > } > > And when I build the DLL using `gcc -shared' the export list `my_func' where > I expected `_my_func' as done with the Microsoft C++ compiler. How are you determining that there's no leading _? It sure looks to me like it's there: $ echo "__declspec(dllexport) void __stdcall my_func (int i) { }" | gcc -S -x c - -o - .file "" .text .globl _my_func@4 .def _my_func@4; .scl 2; .type 32; .endef _my_func@4: pushl %ebp movl %esp, %ebp popl %ebp ret $4 .section .drectve .ascii " -export:my_func@4" $ echo "__declspec(dllexport) void __stdcall my_func (int i) { }" | gcc -c -x c - -o /tmp/foo.o && nm /tmp/foo.o 00000000 b .bss 00000000 d .data 00000000 i .drectve 00000000 t .text 00000000 T _my_func@4 Brian |