1

We are using the FFMpeg static libraries compiled via the --toolchain=msvc switch with the VS2010 compiler linked to the static runtime (-MT). These libraries work fine but they are linked to libcmt.lib.

We would like to compile a debug build of these libraries (i.e. linking against libcmtd.lib). In the configure call I added:

./configure --toolchain=msvc --enable-debug --arch=x86 --extra-cflags=-MTd

This will result in some calls to cl.exe with the -MTd switch but also some with the -MT switch and cause conflicts in the linker stage.

What am I missing?

LostBoy
  • 948
  • 2
  • 9
  • 21
  • What is meaning of "building the static libraries of ffmpeg"? Thanks. – Dr.jacky Dec 07 '15 at 05:54
  • 1
    It means that you don't use a DLL to integrate FFMpeg functionality into your project, but that the features will be compiled into a blob of machine code and linked directly into the application that you are building. Have a look at this: http://stackoverflow.com/questions/2649334/difference-between-static-and-shared-libraries – LostBoy Dec 14 '15 at 13:51

1 Answers1

3

I managed to solve this by using the following configure switches:

./configure --toolchain=msvc --enable-debug --arch=x86 --extra-cflags="-MTd" extra-cxxflags="-MTd" --extra-ldflags="-nodefaultlib:LIBCMT"
LostBoy
  • 948
  • 2
  • 9
  • 21