两个.lib包含不同功能的同名:如何选择正确的一个? [英] Two .lib containing different functions with the same name: how to choose the right one?

查看:233
本文介绍了两个.lib包含不同功能的同名:如何选择正确的一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个静态库lib1.lib,lib2.lib(不是他们的代码)具有相同的功能原型,但具有不同的实现。

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?

推荐答案

应该可以编写与每个静态库链接的thin wrapper DLL。注意,这只有在 lib1.lib lib2.lib 是静态库时才会工作,性能受到影响。

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.

这篇关于两个.lib包含不同功能的同名:如何选择正确的一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆