[Cross Post] C ++中的静态链接 [英] [Cross Post] Static linking in C++

查看:101
本文介绍了[Cross Post] C ++中的静态链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在C#中开发的应用程序使用了一个dll和静态库(lib)。

这个dll是静态库和C#应用程序的中间项目。



客户端提供了与其应用程序交互所需的文件(库文件和dll)。

1.在我们的C ++静态库中,我们仅使用客户端提供的库文件静态链接它。

2.我们的C ++包装器dll引用在步骤1中创建的这个C ++静态库。

3. C#应用程序引用在步骤2中创建的包装器DLL。 br />


由于库文件在我们的C ++静态库中是静态链接的,因此还需要在我们的应用程序中链接/引用dll。

Our application develped in C# uses a dll and static library(lib).
The dll is intermediate project for static libraty and C# application.

Client has provided files(library file and a dll) which is required for interacting with their application.
1. In our C++ static library we are using only the library file provided by client by statically linking it.
2. Our C++ wrapper dll references this C++ static library created in step 1.
3. C# application references the wrapper dll created in step 2.

Since the library file is statically linked in our C++ static library, does the dll also need to be linked/referred in our application.

推荐答案

ps - 请不要交叉发布 - 你已经在c / c ++ / MFC中发布了这个帖子!
ps - please don't cross post - you posted this already in c/c++/MFC !


这篇关于[Cross Post] C ++中的静态链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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