【发布时间】:2015-10-09 14:53:23
【问题描述】:
我有一个包含两个 C++ 项目的 MSVS 解决方案。项目 A 是一个链接到第三方库(tp1.lib 和 tp2.lib)的 DLL,它被项目 B(即 exe)引用。一切都可以正确编译,但是当我运行 B.exe 时,我得到了 tp1.dll 丢失的错误,而我希望第三方库中的相关代码部分应该已经被拉入我的 A.dll 中。
这是我的假设错了吗?如果没有,我需要您知道哪些设置会导致这种行为。在其他设置中,这些是我认为相关的 Properties>ConfigurationProperties 下 Project A 的设置:
- 常规>配置类型:动态库
- C/C++>其他包含目录:%path to third-party include files (.h)%
- Linker>General>Additional Library Directories: %path to the third-party library (.lib)%
- 链接器>输入>附加依赖项:tp1.lib; tp2.lib
然后,在 A.h 中我有:
#include "tp1.h"
#include "tp2.h"
在 A.cpp 中
#include "stdafx.h"
#include "A.h"
【问题讨论】:
标签: c++ dll static-libraries static-linking dynamic-linking