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.
我可以使用 #pragma 链接到单个 obj 文件吗?我试过#pragma comment(lib, "disk_file_sink.obj")了,但它似乎不起作用。如果我在链接器/输入/附加依赖项中指定此文件,它会起作用。
#pragma comment(lib, "disk_file_sink.obj")
我和你有同样的问题,我查了很多网站,但我没有得到结果,所以我用另一种方法来解决这个问题。我就是这样做的。我使用命令lib将 objs 压缩到库中。您可以使用lib /out:xxx.lib one.obj two.obj或lib /out:xxx.lib *.obj。该命令可以添加到项目属性。