What does “#pragma comment” mean?

后端 未结 5 1183
孤城傲影
孤城傲影 2020-11-28 18:03

What does #pragma comment mean in the following?

#pragma comment(lib, \"kernel32\")
#pragma comment(lib, \"user32\")
5条回答
  •  粉色の甜心
    2020-11-28 18:53

    The answers and the documentation provided by MSDN is the best, but I would like to add one typical case that I use a lot which requires the use of #pragma comment to send a command to the linker at link time for example

    #pragma comment(linker,"/ENTRY:Entry")
    

    tell the linker to change the entry point form WinMain() to Entry() after that the CRTStartup going to transfer controll to Entry()

提交回复
热议问题