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.
我一直在使用 MinGW32 编译库并静态链接到我的程序。
我想知道如果我将编译器更改为 TDM-GCC,我的旧库是否会与使用 TDM 编译的新程序链接?还是我应该用新的编译器编译所有东西?
谢谢
您的问题的答案在很大程度上取决于库是什么,以及您如何链接到它们。
如果这些库是 DLL 的导入库,那么您可能不需要重新编译。但是,如果 DLL 需要链接到与宿主可执行文件相同的 C++ 运行时,那么如果宿主可执行文件使用与 DLL 不同的运行时,则需要重新编译。
如果库是静态库,那么如果静态库链接到与其链接到的程序不同的 C++ 运行时,则需要重新编译。