0

I am experimenting with ffmpeg and Windows RT (ARM). First I run configure in a MinGW/MSYS shell:

./configure --enable-shared --disable-static --toolchain=msvc --extra-cflags="-D_M_ARMM -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE -DWINAPI_FAMILY=WINAPI_FAMILY_APP" --enable-cross-compile --target-os=win32 --arch=win32 --extra-ldflags="-MACHINE:ARM" --arch=arm --cpu=armv7

followed by a "make" (in the same shell) which ends with the following error:

C:\Program Files (x86)\Windows Kits\8.1\include\um\combaseapi.h(1157) : 
error C4013: 'CoCreateInstanceFromApp' undefined; assuming extern returning int
make: *** [libavformat/format.o] Error 2

The environmental variables in the shell are set to ARM Visual Studio 2013.

What does this error mean? Can someone point me in the correct direction how to fix this problem?

Regards,

Hyndrix
  • 4,282
  • 7
  • 41
  • 82
  • Is `combase.lib` linked? – WiredPrairie Jan 02 '14 at 15:03
  • If I add `-LRuntimeObject.lib` and `-Lcombase.lib` to `--extra-ldflags` then nothing changes. – Hyndrix Jan 02 '14 at 15:15
  • 1
    I just added the function to a sample C++ Windows Store application and it built without any issue. It seems like one of the headers isn't correctly included. The function wouldn't be defined if you hadn't already included winapifamily.h. `#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)` – WiredPrairie Jan 02 '14 at 17:39

1 Answers1

0

Make sure you are correctly defining the version of the Windows API you're targeting. To target COM-based API (e.g. MediaFoundation) on the Windows Runtime-based platforms, you must set _WIN32_WINNT=0x0603 in the compiler settings before including . A good place to do this is in the Visual Studio project settings:

Visual Studio Project Property Pages C++ Preprocessor settings

bleater
  • 5,098
  • 50
  • 48