Two .lib containing different functions with the same name: how to choose the right one?

℡╲_俬逩灬. 提交于 2019-12-13 14:19:22

问题


I have two static libraries lib1.lib, lib2.lib (not their code) with the same function-prototypes, but with different implementations.

I tried including both, and it seems to use always the implementation from the first library included.

If I include both of them in my project, is there a way to choose the implementation from a specific library?


回答1:


I think it should be possible to write thin wrapper DLL's that link against each of the static libraries. Notice that this will only work if lib1.lib and lib2.lib are static libraries and that such a wrapping will incur a performance hit.



来源:https://stackoverflow.com/questions/15497220/two-lib-containing-different-functions-with-the-same-name-how-to-choose-the-ri

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!