|
Now write a dll with DEV-C ++, generate a static library file of .a and a dynamic library of .dll, then write a console program with DEV-C ++, and call the function of the dll by linking the above .a file , Ok, through.
Later in VC2003, the same console program also linked the .a file, called the .dll, compiled and passed, no problem, but reported an access violation when calling the function in the DLL during execution.
In VC2003, do not link the .a file, use LoadLibrary and GetProcAddress to load the functions in the .dll, and execute, OK, pass.
Why does an error occur when linking .a files in VC2003? Are .a files and VC writing dlls different in the format of generating .lib files? Then why does VC compile and link .a files without problems? How can I make Dev-C ++ DLLs call DLLs by linking .a files? (All functions to be called are more painful using GetProcAddress) |
|