Home > Software engineering >  VC6 project by implicitly link to invoke a derived class of dynamic link library (VS2015 version)
VC6 project by implicitly link to invoke a derived class of dynamic link library (VS2015 version)

Time:11-10

existing A VC6 project, A dynamic link library (VS2015 version)
BA in the form of implicit link (you need to import the library files and DLL) call interface, B
Compile the project A, tip error: cannot resolve the external symbol, in VC6 project, interface name, cannot distinguish between B

Dynamic link library interface is a class B export, the export way are as follows:

 
MyClass class _declspec (dllexport)
{
Public:
Void do_something1 ();
Void do_something2 ();
.
.
};
morning found on the Internet, seems to be due to the different versions of the compiler ABI (binary interface) caused by incompatible,
Can use the factory function method to solve this problem,
(see: https://eli.thegreenplace.net/2011/09/16/exporting-c-classes-from-a-dll/)

My question is:
In VC6 project by implicitly link to invoke dynamic link libraries provide the class interface, B will fail?
Thank you for guidance communication

CodePudding user response:

No implicit link of this statement, only the static and dynamic links, you should be a static link, static link in version inconsistent situation is likely to fail, but usually can be successful, only DLL export is correct

CodePudding user response:

Simple - Soft references 2 floor response:
no implicit link of this statement, only the static and dynamic links, you should be a static link, static link in version inconsistent situation is likely to fail, but usually can be successful, only DLL export right

Ok, I am not rigorous, it should be "implicit load", I said is called dynamic link library in two ways: "implicit load" and "display loaded",
I put the "implicit load" with links to "implicit" and let you think I said is static and dynamic links,

Static link is the program compiled phase [link] will static library (static library) functions in the code and data written to the executable file;

With dynamic linking, in the program at compile time, will not write function code and data to the executable file,
If implicit loading the dynamic link library, compile the program to import libraries (import library) in the link to the executable file, the program run time will the function in the DLL is loaded into the code and data memory, note: import libraries (import library) contained in the content of symbols are used to find the DLL file,
If according to loading the dynamic link library, you don't need to import libraries (import library), by calling LoadLibrary in application runtime DLL functions in the code and data loading into memory,

CodePudding user response:

Simple - Soft references 2 floor response:
no implicit link of this statement, only the static and dynamic links, you should be a static link, static link in version inconsistent situation is likely to fail, but usually can be successful, only DLL export right

In addition, I protest, collection of links to "implicit" this statement, "implicit link it says to me" "implicit load" is a meaning,
Please refer to: https://docs.microsoft.com/en-us/previous-versions/d14wsce5 (v=vs. 140)? Redirectedfrom=MSDN

CodePudding user response:

reference 4 floor docker_007 response:
Quote: refer to the second floor Simple - Soft reply:

No implicit link of this statement, only the static and dynamic links, you should be a static link, static link in version inconsistent situation is likely to fail, but usually can be successful, only DLL export right

In addition, I protest, collection of links to "implicit" this statement, "implicit link it says to me" "implicit load" is a meaning,
Please refer to: https://docs.microsoft.com/en-us/previous-versions/d14wsce5 (v=vs. 140)? Redirectedfrom=MSDN


You're right

CodePudding user response:

Derived class is a pit,,,
  • Related