__declspec是一个Microsoft Visual C++特定的编译器属性开关。括号中指明的是哪一个属性生效。 关于__declspec的其他属性可以百度“__declspec msdn”查看微软的官方帮助。也可以参看博客中转载的文章。 言归正传。__declspec(selectany)在MSDN中的说明是这样的: Tells the compiler that the declared global data item (variable or object) is a pick-any C…