Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想有条件地将我的代码链接到静态库,这取决于编译标志。
无论如何我可以在 C++ 中做到这一点吗?
您可以使用编译指示来做到这一点:
#ifdef YOUR_CONDITION #pragma comment (lib, "YourLibrary.lib") #endif