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.
我正在尝试将 tcmalloc 插入我们目前在工作中使用的一套软件中。该软件包含大量的dll。它们都引用了一个共享的头文件,所以我可以编译链接库。
然而,由于没有代码引用符号 __tcmalloc,优化器会剥离 dll。现在我不想编辑 200 个项目文件并在每个文件中添加符号引用。所以我的问题是,有没有办法以编程方式添加符号引用?
为了增加一些清晰度,我在 Visual Studio 2005 下编译。
啊,对于任何寻找这个答案的人来说,如下
#pragma comment(linker, "/include:__tcmalloc")