Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if dll generated is statically or dynamically linked?

Following is my linking command:

Running Mkbootstrap for XML::SAX::ExpatXS ()
    C:\Perl\bin\perl.exe -MExtUtils::Command -e chmod -- 644 ExpatXS.bs

link -out:blib\arch\auto\XML\SAX\ExpatXS\ExpatXS.dll -dll -nologo -nodefaultlib -debug -opt:ref,icf  -libpath:"C:\Perl\lib\CORE"  -machine:x86 ExpatXS.obj -def:ExpatXS.def
Creating library blib\arch\auto\XML\SAX\ExpatXS\ExpatXS.lib and object blib\arch\auto\XML\SAX\ExpatXS\ExpatXS.exp

The compilation flags used are /Zi /GF /MD -c

I want to know if this dll is getting statically or dynamically linked. I referred http://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx but the compiler ignores these options when I specify them in my makefile.

Thanks

like image 321
Capricorn Avatar asked Oct 18 '25 06:10

Capricorn


1 Answers

Your snippet only shows the DLL getting built, it doesn't say anything about the program that uses the DLL. Which has the choice to use the DLL either way.

If you have no idea then a simple way to find out is to run Dumpbin.exe /imports on the EXE. You'll see the exports from the DLL that are actually used listed in the output. If you don't see anything then the DLL could only be dynamically loaded. Or not at all. The debugger shows notifications for DLLs that get loaded into a process, you'll see them in the Output window.

like image 190
Hans Passant Avatar answered Oct 20 '25 06:10

Hans Passant



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!