#pragma comment

Source: Internet
Author: User
Tags deprecated

This article was transferred from Microsoft MSDN. Note that this is only available on Windows, not on Linux.

#pragma comment (Comment-type [, "commentstring"])
Notes   Comment-typeis a predefined identifier (described below) that specifies the type of note record.Optional commentstring is a string that provides additional information about some types of annotations. because Commentstring is a string, it follows all rules about escape characters, embedded quotation marks ( "), and concatenated strings. 1. Compiler
   Place the name and version number of the compiler in the object file. This note record will be ignored by the linker. if the commentstring parameter is supplied for this record type , the compiler generates a warning.
2. Exestr
   commentstring in the object file. > Place the  commentstring  in the object file.   when loading an executable file, the string is not loaded into memory, but you can find it by using a program that finds a printable string in the file.   One purpose of this note record type is to embed a version number or similar information into an executable file.
commentstring in the object file. > in future releases, EXESTR will be deprecated and removed, and the linker will not process comment records.
3. lib
   Place the library search record in the object file.This annotation type must have a name (and possibly a path) that contains the library you want the linker to search.commentstring  parameter.  /nodefaultlib. " The library name follows the default library search record in the object file; The linker searches for this library, just as it is named on the command line, provided the library is not used  /nodefaultlib  specified.   Multiple library search records can be placed in the same source file, and individual records appear in the object file in the order in which they appear in the source file.
commentstring parameter containing the name (and possibly the path) of The library that's want the linker to search. " >/nodefaultlib. " > if the order of the default and added libraries is important, compiling with the/ZL switch prevents the default library name from being placed in the object module. you can then use another comment pragma to insert the name of the default library after the added library. The libraries listed with these pragmas appear in the object module in the order in which they are found in the source code.
4. Linker
linker option in the object file. " > Place the linker options in the object file.   For example, you can specify the/INCLUDE option to enforce the inclusion of symbols:
  #pragma COMMENT (linker, "/include:__mysymbol")
   Only the following ( comment-type) linker options can be passed to the linker identifier:
1)/defaultlib
2)/export
3)/include
4)/manifestdependency
5)/merge
6)/section
5. user-Users
   Places a generic comment in the object file. The commentstring parameter contains the comment text. This note record will be ignored by the linker.
commentstring parameter contains the text of the comment." >
  #pragma comment (lib, "Emapi")
   The following pragma causes the compiler to place its name and version number in the object file:
  #pragma comment (compiler)
#pragma comment (user, "Compiled on" __date__ "at" __time__)

#pragma comment (go)

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.