简体   繁体   中英

Build native C++ library and use it in WP8 app

I have a C++ project developped on Eclipse. My project will be use as native source code for various mobile platforms like Android, iOS, Windows Phone...

I would like to compile this library to be used on Windows Phone 8 devices. My needs with this library would just be calling a function.

I know that I must use a Windows Phone Runtime Component, like the tutorial http://www.silverlightshow.net/items/Windows-Phone-8-Native-Code-Support.aspx ; but :

Question 1 : what library format should I build ? .dll library ?

Question 2 : how can I use this dll inside my Windows Phone Runtime Component, and therefore call the method I need ?

Thanks a lot for your advices;

  1. You will need to build it as a DLL, but specifically it needs to be a WP8 runtime DLL, that comes with restrictions that may not be compatible with your existing source. This MUST be built using the WP8 SDK, which means that MSBuild is probably your only option unless you want a lot of pain.
  2. You will create a project to project reference in Visual Studio between your app and the DLL you built.
  3. All components shipped in a WP8 app MUST be WP8 runtime, so you will have to wrap your source in WP8 runtime interfaces in the same DLL.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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