Def file private

Source: Internet
Author: User

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 ~


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.