Question

When reading about WP8 C++ project template, I see

Windows Phone Empty Dynamic Link Library

A project for creating a native dynamic-link library for a Windows Phone app.

Windows Phone Empty Static Library

A project for creating a native static library for a Windows Phone app.

What are static library and dynamic link library mean to WP8?

Supposed I have my Windows library source (openssl for example), do I need to convert to WP8 static library to be consumed by WP8 apps?

Whether I use WP8 static or dynamic link library, I must wrap them in WP8 runtime component in order for my app to consume, am I right ?

Was it helpful?

Solution

At the basic level, static and dynamic libraries are the same as any other Windows environment (so see this other SO question for more clarification).

For a WP8 app you will either need to produce:

  1. A XAML .NET/Windows Runtime hybrid app.
  2. A DirectX C++/C project (usually a game).

For 1. you would need to wrap up either your static .lib or .dll in a WP8 Runtime component, for your .NET side to consume.

For 2. it looks like you end up building a traditional .exe. In that case you would link directly to your .lib or .dll in the normal way. (I not so familiar with this one, so may be missing some subtleties here).

In any case it's easier to link everything if you have all the source code in VS and reference the projects that build .lib or .dll you need, rather than the referencing the binaries themselves.

That way you can ensure all the code is built to target the correct runtime environment (targetting the Phone APIs, using the correct CPU architecture). Also VS should then automatically add all dependencies into your final XAP package.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top