简体   繁体   English

Windows Phone和ANSI C(非C ++)库

[英]Windows Phone and ANSI C (not C++) library

Is there any way to write / include ANSI C written library to my Windows Phne 8 app project? 有没有办法在我的Windows Phne 8应用程序项目中编写/包含ANSI C编写的库? I know it's possible with Windows Phone Runtime Component for C++ but here is my question, it is possible for ANSI C? 我知道可以使用Windows Phone Runtime Component for C ++,但这是我的问题,ANSI C可能吗? The goal is cross-mobile library for Android, iOS and windows Phone 目标是Android,iOS和Windows Phone的跨移动库

Microsoft has fixed the [DllImport] in WP 8.1. 微软已经修复了WP 8.1中的[DllImport] If you target WP 8.1, you can compile your ANSI C library into the DLL and invoke your DLL directly from the C# code, without any C++/CX component. 如果您的目标是WP 8.1,则可以将ANSI C库编译到DLL中,并直接从C#代码调用DLL,而不需要任何C ++ / CX组件。

Update: Please note you must use visual studio to build that DLL. 更新:请注意您必须使用visual studio来构建该DLL。 Also, remember the native code is always CPU-specific, which means you'll need separate x86 build for the emulator, and ARM build for testing on hardware devices, and for the store. 此外,请记住本机代码始终是特定于CPU的,这意味着您需要为仿真器单独构建x86,并且需要ARM构建以在硬件设备和存储上进行测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM