What is inside .lib file of Static library, Statically linked dynamic library and dynamically linked dynamic library?

For a static library, the .lib file contains all the code and data for the library. The linker then identifies the bits it needs and puts them in the final executable. For a dynamic library, the .lib file contains a list of the exported functions and data elements from the library, and information about which … Read more

What is a dll?

A DLL is a dynamic link library. It is a collection of code and/or data, which may be used by several applications (or other libraries/modules). So for instance common methods to process files, work with GUI components etc. are made available in libraries so several applications may use the same functionality. This not only reduces … Read more

java.lang.UnsatisfiedLinkError no *****.dll in java.library.path

In order for System.loadLibrary() to work, the library (on Windows, a DLL) must be in a directory somewhere on your PATH or on a path listed in the java.library.path system property (so you can launch Java like java -Djava.library.path=/path/to/dir). Additionally, for loadLibrary(), you specify the base name of the library, without the .dll at the … Read more

Dependency Walker reports IESHIMS.DLL and WER.DLL missing?

ieshims.dll is an artefact of Vista/7 where a shim DLL is used to proxy certain calls (such as CreateProcess) to handle protected mode IE, which doesn’t exist on XP, so it is unnecessary. wer.dll is related to Windows Error Reporting and again is probably unused on Windows XP which has a slightly different error reporting … Read more

Dependency Walker: missing dlls

These are API-sets – essentially, an extra level of call indirection introduced gradually since windows 7. Dependency walker development seemingly halted long before that, and it can’t handle API sets properly. So these are all false alarms and nothing to worry about. You’re not missing anything. Also see On API-MS-WIN-XXXXX.DLL, and Other Dependency Walker Glitches. … Read more

what does __declspec(dllimport) really mean?

__declspec is a Microsoft-specific attribute that allows you to specify storage-class information. (Nitpicker’s Corner: However, a number of other compiler vendors—e.g. GCC—now support this language extension for compatibility with the installed base of code that was written targeting Microsoft’s compilers. Some even provide additional storage-class attributes.) Two of those storage-class attributes that can be specified … Read more

Loading DLLs at runtime in C#

Members must be resolvable at compile time to be called directly from C#. Otherwise you must use reflection or dynamic objects. Reflection namespace ConsoleApplication1 { using System; using System.Reflection; class Program { static void Main(string[] args) { var DLL = Assembly.LoadFile(@”C:\visual studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\DLL.dll”); foreach(Type type in DLL.GetExportedTypes()) { var c = Activator.CreateInstance(type); type.InvokeMember(“Output”, BindingFlags.InvokeMethod, null, … Read more

Dynamically load a function from a DLL

LoadLibrary does not do what you think it does. It loads the DLL into the memory of the current process, but it does not magically import functions defined in it! This wouldn’t be possible, as function calls are resolved by the linker at compile time while LoadLibrary is called at runtime (remember that C++ is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)