#Pragma usage seen in the first two days

xiaoxiao2021-03-04  59

In the first two days, the BCB was used to perform WinsDK programming. The dead activities could not load the resource file (* .res), and the written RC file is not problematic, and the resource file can also be generated with BRCC32, but it is unable to link the source code (if It's better to use IDE, but I am so useful to use the command line to compile), Best can't make a few, countless posts, the result is still not available.

Later, I used Google, I found that I can use the #pragma compile instruction to control, I found the answer in some of the 9CBS articles, and I found some other related techniques, write down to remember.

#pragma usage

This is a compilation control command that can dynamically adjust the compile option when compiling, which is different in different compilation systems.

#pragma Warning (Disable 4068) does not display 4068 warning information, if you always have a 4068 warning, but it is considered that there will be no errors, you can use this instruction. This instruction C Builder and VC are supported. If you don't use a parameter inside the function, "Parameter Name is never buy in function func-name" is reported when compiled, using #pragma argsused, and no longer warned when compiling. VC does not support this instruction. Detailed description of all #pragma in the help of C Builder and VC .

#pragma hdrstop Represents the pre-translated header file to this, and the back header file is not precompiled. The BCB can pre-translate the header file to speed up the speed of the link, but if all header files are pre-compiled, it may account for too much disk space, so use this option to exclude some header files. There is a dependency between the units, such as unit A dependent unit B, so unit B is compiled by unit A. You can use #pragma startup to specify compilation priority, if #pragma package (smart_init) is used, BCB will compile according to the size of the priority. #Pragma resource "* .dfm" indicates the addition of resources in the * .dfm file. * .dfm includes the definition of the form of the form.

When using #pragma, pay attention to the mutual location of the header file, in C Builder, focus on the #pragma field, press F1 to get more more detailed usage introduction.

转载请注明原文地址:https://www.9cbs.com/read-31732.html

New Post(0)