我成功地使用本教程創建了一個引用C++ DLL的C++可執行文件:http://programmingexamples.wikidot.com/blog:1。將程序鏈接到DLL時需要執行的其他步驟
我是一個.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是兩個完全不同的語言,但是我還不明白爲什麼需要這些額外的步驟。