If a program have to rely mainly on windows native dll, it is often preferable not to use the GNU Tools.
In Windows, a dynamic-link library (.dll) file has no dangling references. Instead, an access to functions or data goes through a lookup table. So the DLL code does not have to be fixed up at runtime to refer to the program's memory; instead, the code already uses the DLL's lookup table, and the lookup table is modified at runtime to point to the functions and data.
In Windows, there are two types of library, a static library and an import library (both called .lib). A static library is like a Unix .a file; it contains code to be included as necessary. An import library is basically used only to reassure the linker that a certain identifier is legal, and will be present in the program when the .dll is loaded. So the linker uses the information from the import library to build the lookup table for using identifiers that aren't included in the .dll. When an application or a .dll is linked, an import library may be generated, which will need to be used for all future .dll's that depend on the symbols in the application or .dll.
If there are not functions marked for export, the liker will not generate an import library.
See /EXPORT
C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT
C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat
A good reference about the MS toolchain.
The following makefiles:
CC=cl CC_FLAGS=/TP /GR /EHsc SRC_EXT=c OBJ_EXT=obj INCLUDE=/I"C:\Program Files\Microsoft SDKs\Windows\v6.0\Include" \ /I"C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\INCLUDE" LIB=/LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v6.0\Lib" \ /LIBPATH:"C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\LIB"
LIBS=WinMM.Lib MODULES=pa_convert.obj \ pa_trace.obj \ pa_win_wmme.obj \ pa_lib.obj TARGET=portaudio all: $(TARGET).dll clean: rm -rf $(MODULES) $(TARGET).dll $(TARGET).lib $(TARGET).exp $(TARGET).dll: $(MODULES) link $(LIB) $(LIBS) $(MODULES) /dll /out:$(TARGET).dll cp $(TARGET).dll .. cp $(TARGET).lib .. %.$(OBJ_EXT): %.$(SRC_EXT) $(CC) $(CC_FLAGS) $(INCLUDE) /c $<
LIBS=portaudio.Lib MODULES=patest_sine.obj TARGET=test.exe all: $(TARGET) clean: rm -rf $(MODULES) $(TARGET) $(TARGET): $(MODULES) link $(LIB) $(LIBS) $(MODULES) /out:$(TARGET) rm -rf $(TARGET).manifest %.$(OBJ_EXT): %.$(SRC_EXT) $(CC) $(CC_FLAGS) $(INCLUDE) /c $<
Dependency Walker is a free utility that scans any 32-bit or 64-bit Windows module (exe, dll, ocx, sys, etc.) and builds a hierarchical tree diagram of all dependent modules. For each module found, it lists all the functions that are exported by that module, and which of those functions are actually being called by other modules. Another view displays the minimum set of required files, along with detailed information about each file including a full path to the file, base address, version numbers, machine type, debug information, and more.
Ever wondered which program has a particular file or directory open? Now you can find out. Process Explorer shows you information about which handles and DLLs processes have opened or loaded.
DebugView is an application that lets you monitor debug output on your local system, or any computer on the network that you can reach via TCP/IP. It is capable of displaying both kernel-mode and Win32 debug output, so you don't need a debugger to catch the debug output your applications or device drivers generate, nor do you need to modify your applications or drivers to use non-standard debug output APIs.