How to compile ffmpeg for Qt use on Windows? - windows

I want to use ffmpeg libs for programming in Qt.
How can I compile ffmpeg into *.lib files on Windows?
or
How can I use the compiled *.dll files which are released officially in Qt?
Also, which way is better?

Use the automated builds
You will need the devel build (which includes all the header files) then you can also download the shared build which has the dlls
edit: MSVC isn't C99 compliant so you need stdint.h eg http://code.google.com/p/msinttypes/

Related

How to Convert 64bit COFF to OMF?

I need to convert a 64bit .lib file from COFF to OMF. Coff2Omf.exe works fine with 32bit libs but gives...
ERROR: COFF error: FOOx64.lib
(coffread.cpp, 1637) : invalid machine type detected
...on a 64bit lib.
Is there an updated tool or similar to use for this?
Per Embarcadero's documentation:
Differences Between Clang-based C++ Compilers and Previous-Generation C++ Compilers
Object and Library File Format
BCC32 and its associated tools use OMF in .obj and .lib files.
Clang-based C++ compilers use ELF in .o and .a files.
This difference means, for example, that when you migrate a 32-bit Windows applications you must change references to .lib and .obj files to be .a and .o, respectively.
BCC64.EXE, the C++ 64-bit Windows Compiler
Compiled object file
ELF64 format
#pragma link
Do not specify the file extension (.ext) of modulename, as long as you are using default file types. The linkers assume the following default values for the file extension (.ext) of modulename:
.obj extension for BCC32
.o extension for:
Clang-based C++ compilers
BCCOSX
So if you omit the .ext, then the correct extension is automatically used according to your current target platform.
OMF is only used by the 32bit compiler/linker. The 64bit compiler/linker uses ELF64 instead.
I wonder if OMF specification have ever existed for 64-bit architecture. By the way, why do you need 64-bit OMF files? 64-bit versions on C++Builder are based on LLVM compiler backend, which produces ELF object files (as far as i know)
I don't know if something like coff2elf is bundled with C++Builder XE7, but, probably you can use opensource tools, like "Object File Converter", look for it here:
http://www.agner.org/optimize/#objconv

Build dynamic windows library (DLL) from libmcrypt with MinGW

I'm trying to build libmcrypt library to use it with my project. It happened so, that they do not provide any kind of assistance.
First I've faced a problem with -no-undefined flag for gcc which is not further supported. I've replaced -no-undefined with -Wl,-no-undefined in makefiles and it does the trick.
But anyway I'am having problems. Lib is builded in .a files. I can see them in my C:\MinGW\msys\1.0\local\lib folder (it is analogue for /usr/local/lib folder in MinGW). But I need .dll library, not static .a .
So: what else must I change in makefiles to make MinGW build dll with header and debug info for it?

Link ffmpeg lib statically in Visual Studio

I'm trying to use ffmpeg in my C++ project on VS2010, and the ffmpeg dev version provides the lib of .h files. I linked these .libs in my projects and the corresponding .dlls are required when running the .exe file. But I want to link the ffmpeg lib statically and running without .dlls.
I tryed to compile the ffmpeg source code on windows with Mingw, only resulting on some .a archive files. How to get ffmpeg static .lib files? And it's a 64bit program so 64bit static lib is required.
In your output directory, you have some *.def files. You can use these files to get your *.lib files. The syntax is:
lib /def:avcodec-54.def /out:avcodec-54.lib
Use the lib.exe of your VS version. Mine is located in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin. Check the command line options (it way be useful to add /machine:i386).
Another way to do this: instead of using windows's cmd directly to start msys/mingw, first start VS command prompt (you can start it from Start menu). It will set some environment variables. From here, compile FFmpeg with msys/mingw: FFmpeg build will autodetect that VS is present, thus will auto-perform the libcall.
Edit: Sorry, I skipped the "static" part of the question. Here are some tips for a static build (note that I've never build a static FFmpeg used inside visual studio, so maybe it will not work).
First, of course, FFmpeg must be built with the static options: just to be sure, I use these options, so I have no .def of shared files:
./configure --enable-static --disable-shared [other options]
In order to have statically files, you may directly use the .a files (again: I never thried this). Check this question.
If it does not work, you can try the visual studio toochain instead of gcc. But be careful: last time I tried this (but a shared dll), FFmpeg decoding was slower when build from msvc than gcc's output. Check this page for detailed build instructions.

Using GMP on windows

I am trying to use GMP in a C++ program on windows, and I compiled it successfully with Cygwin, and I get an .a file, which is linux's version of a .lib file. Is there a way I can use this with the Visual C++ compiler, or is there a way to compile GMP for windows to produce a .lib file?
I don't know about creating a .lib file, but you may want to look at mpir. MPIR is a fork of GMP that compiles with Visual Studio 2008 and 2010.

How to static analyze C++ and Objective-C++ code?

The "Build and analyze" option doesn't seem to work for .cpp and .mm files. I tried "clang --analyze" on individual files without any standard #includes and it works well. However I'm not able to run it on my Xcode project. I couldn't figure out a way to make clang find the standard #includes like even UIKit.h. Any clues?
clang's C++ support is not complete yet clang web site
Apple's version is more explicit clang man page
Clang currently does not have C++ support
One way is to create symlinks to the Frameworks present in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.2.sdk/System/Library/Frameworks/XXX.framework/Headers and point clang to the symlinks using the -I option.

Resources