Visual studio 2013中的项目配置

Project configuration in Visual studio 2013

本文关键字:项目 配置 studio 2013 Visual      更新时间:2023-10-16

我有三个级别的应用程序,应该由windows移动应用程序使用。C++中间件使用的C库(配置为静态库)(当然是通过引用,并创建为dll)。然后我有一个包装器c++/cli来将非托管代码映射到托管代码。

因此,包装器正在使用dll(通过引用)。

现在,当使用包装器运行我的C#测试时,我会出现以下错误:

  • 错误LNK1561:入口点必须定义

  • 另外,它没有看到wrapper.exe

有什么帮助吗???

感谢

您似乎误解了"模块"一词。Visual Studio中没有这样的C++项目;C++项目可以分为三类:

Programs - compilation produces an exe file, which may be executed;
Static libraries - compilation produces a lib file, which may be included in another project and are linked during the compilation;
Dynamic libraries - compilation produces a dll file, which may be attached to your program at run-time and provide additional functionality.

根据您的描述,您希望projectB和projectC是一个静态库,但您却将它们创建为可执行文件。再次运行新项目向导,然后选择"静态库"而不是"Windows应用程序"。

您可以在MSDN库中阅读更多关于静态库的信息。

如果静态库对于您的应用程序来说太重,您可以简单地在项目中包含projectB和projectC文件(可以选择注意名称空间,以免混淆类的名称)。这完全取决于您计划在这些"模块"中实现多少功能。