【发布时间】:2014-11-30 03:21:30
【问题描述】:
我已经成功地使用本教程创建了一个引用 C++ DLL 的 C++ 可执行文件:http://programmingexamples.wikidot.com/blog:1。
我是一名 .NET 开发人员。使用 .NET,您只需从控制台项目中添加对 DLL 的引用。使用 C++,您必须执行三个步骤(所有步骤都包含在链接中的第四步中)。我的问题是:
1) Why do you have to add the LIB as an Additional Dependency (step 4, part 1). I believe it acts as a stub for the DLL, which is the skeleton. This is not needed using .NET.
2) Step 4 (part 2) asks you to move the DLL to the same directory as the calling program. Do you8 have to do this for every calling
program? I assume that if you add a reference to the DLL
(Properties/Common Properties/Add New Reference) that this step is not
needed?
3) Step 4(part 3) states that you must specify the location of the header files. Why is this step needed if the header files are part of the DLL. Is this because they are precompiled?
我知道 C++ 和 Visual Basic.NET/C#.NET 是两种完全不同的语言,但是我还不明白为什么需要这些额外的步骤。
【问题讨论】:
标签: .net visual-c++