本文介绍了将旧的 C/C++ 库与 Windows 8 Metro 应用程序一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用开源库 (Linphone) 用 C/C++ 编写.我尝试在VS11中导入它,没有成功.我有所有可能需要的 .dll 文件.

I'm trying to create an application (in C#) for Windows 8 / Windows Phone 8 using an open-source library (Linphone) written in C/C++.I tried importing it in VS11, no success.I have all .dll files that could be needed.

有没有办法在有或没有 VS11 的情况下使用这个库来创建我的应用程序?

Is there a way to create my app using this library with or without VS11?

谢谢.

推荐答案

您不能在 Windows 8 应用商店应用中使用使用旧版 Visual Studio(早于 Visual Studio 2012)构建的二进制文件.

You cannot use binaries built using older version of Visual Studio (older than Visual Studio 2012) in your Windows 8 Store apps.

原因是因为使用 Visual Studio 2010 构建的二进制文件将依赖于 Visual Studio 2010 中的 C++ 运行时 DLL.而您的应用程序的其余部分是使用 Visual Studio 2012 编写的,因此它将依赖于Visual Studio 2012 中的 C++ 运行时 DLL.后者可从 Windows 应用商店自动获取 (阅读本文了解更多详情).但是前者在 Windows 应用商店中不可用.此外,您的应用无法表达对 VC2010 运行时的依赖.在应用程序包中包含 VC2010 运行时 DLL 也将不起作用,因为该包将在商店上传时被拒绝.

The reason for that is because a binary built using say Visual Studio 2010 will have a dependency on the C++ Runtime DLLs from Visual Studio 2010. Whereas the rest of your app is written using Visual Studio 2012 so it will have a dependency on C++ Runtime DLLs from Visual Studio 2012. The latter is made automatically available from the Windows Store (read this for more details). However the former is not available on the Windows Store. Also, there is no way for your app to express a dependency on VC2010 Runtime. Including VC2010 Runtime DLLs inside the app package will also not work since the package will be rejected at Store upload time.

因此,最好的选择是严格使用 Visual Studio 2012 为您的 Windows 8 应用商店应用构建所有源代码.

Therefore the best option is to build all sources for your Windows 8 Store app strictly using Visual Studio 2012.

这篇关于将旧的 C/C++ 库与 Windows 8 Metro 应用程序一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 01:29