Search code examples
c++cwindows-phone-8.1windows-10-mobileupnp

Compiling Portable UPnP Library for Windows Phone 8.1 or 10


I need to compile a Portable UpnP library (http://pupnp.sourceforge.net/) for Windows Phone 8.1 or 10.

The library can be compiled in x86 Windows 10 and one person (https://github.com/atraczyk/libupnp) has already created the missing the VS 2015 project files for the library. I used this version and changed the project target to ARM and did several other changes like the following.

And, I successfully accomplished to compile pthread-win32, ixml and threadutil projects.

However; The actual project, libupnp, didn't compile because of missing iphlpapi library in Windows Phone environment. I searched online and stackoverflow. And I couldn't find any solution to compile the library without iphlpapi or with a replacement of it. I hope you can guide me on how to compile the library.

TL;DR

Is there any way that I can include iphlpapi library to a Windows Phone 8.1 ARM project to compile the Portable UPnP library for Windows Phone 8.1 ARM based device.

Clarification, I am sticking with this version of the UPnP even though I know there are alternatives. Because, other platforms (Android and iOS) are using this library and there is a common C code that we need to use in all platforms. So, changing the library is not an obvious solution.


Solution

  • I can see an ARM lib of the IPHlpApi.Lib on my system at C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\arm\IPHlpApi.Lib. Add this to the linker option of the solution.