Uncle Microsoft has already explained the def file private ~ But some people still don't understand it ~ No one wrote clearly on the Internet that Uncle Microsoft wrote:
The optional private keyword prohibits you from placing entryname in the import/export repository generated by link. It is invalid for exporting images generated by links. (Original address: http://msdn.microsoft.com/zh-CN/library/hyx1zcd3 (V = vs.80). aspx)
It is clearly written that entryname will not be written into the import/export database. What is import and export, which is the XXX. Lib generated during the link
Example:
// Testdll. def without privatelibrary testdllexportsadd // test. CPP # include "stdafx. H "# include" header. H "# pragma comment (Lib," testdll. lib ") int _ tmain (INT argc, _ tchar * argv []) {int A = add (1, 2); printf (" % d ", a); getchar (); return 0 ;}
The link is correct and runs properly;
What if the prvate keyword is added ~
The error message "cannot be linked to add" appears.
The role of prvate is to not use the Lib file to implicitly link the modified add, because it is not included in the Lib file,
Therefore, the function exported by prvate can only be used in the display method ~