AliR.
On Thu, 29 Mar 2007 17:28:14 GMT, "David Ching"
<dc@remove-this.dcsoft.com>
wrote:
"Doug Harrison [MVP]" <dsh@mvps.org> wrote in message
news:lcqn03lia17h9i08r3ij81ovh5ghfu50ev@4ax.com...
On Thu, 29 Mar 2007 09:57:54 +0200, mosfet <richom.v@free.fr> wrote:
One doesn't preclude the other. Of course, when an exported function is
inlined, you might as well be linking statically WRT compilation
dependencies, because the DLL's code becomes part of its client's code.
I would think it does matter. I can't see how an exported function can be
inlined.
Below, the compiler ignores the import attribute and inlines X::f:
__declspec(dllimport) void g();
struct __declspec(dllimport) X
{
void f() { g(); }
};
void h(X& x)
{
x.f();
}
X>cl -O2 -FAs -c a.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for
80x86
?h@@YAXAAUX@@@Z PROC ; h, COMDAT
; 10 : x.f();
jmp DWORD PTR __imp_?g@@YAXXZ
?h@@YAXAAUX@@@Z ENDP ; h
If you change the imports to exports and compile a DLL, you will find the
compiler has exported X::f.
--
Doug Harrison
Visual C++ MVP