Как установить yasm на windows 10

I need YASM software in Windows 10 in Microsoft visual 2015 could any one tell the steps for installing yasm. I already uses the below link. https://github.com/yasm/yasm/tree/master/Mkfiles with the

I need YASM software in Windows 10 in Microsoft visual 2015 could any one tell the steps for installing yasm.
I already uses the below link.
https://github.com/yasm/yasm/tree/master/Mkfiles

with the help of source code I am not able to install yasm i got lots of errors in it.

asked Dec 19, 2017 at 8:29

Kiwi Rupela's user avatar

I read somewhere that Windows users are advised to install yasm via Chocolatey

First, you need to install chocolately and after that you just need to run the following command:

choco install yasm

So, You just need to run only two commands one for chocolately installation and another one for yasm. :)

answered Dec 19, 2017 at 9:16

Twinkle's user avatar

TwinkleTwinkle

3943 silver badges17 bronze badges

Basic Installation ================== These are generic installation instructions. The `configure’ shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile’ in each directory of the package. It may also create one or more `.h’ files containing system-dependent definitions. Finally, it creates a shell script `config.status’ that you can run in the future to recreate the current configuration, a file `config.cache’ that saves the results of its tests to speed up reconfiguring, and a file `config.log’ containing compiler output (useful mainly for debugging `configure’). If you need to do unusual things to compile the package, please try to figure out how `configure’ could check whether to do them, and mail diffs or instructions to the address given in the `README’ so they can be considered for the next release. If at some point `config.cache’ contains results you don’t want to keep, you may remove or edit it. The file `configure.in’ is used to create `configure’ by a program called `autoconf’. You only need `configure.in’ if you want to change it or regenerate `configure’ using a newer version of `autoconf’. The simplest way to compile this package is: 1. `cd’ to the directory containing the package’s source code and type `./configure’ to configure the package for your system. If you’re using `csh’ on an old version of System V, you might need to type `sh ./configure’ instead to prevent `csh’ from trying to execute `configure’ itself. Running `configure’ takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make’ to compile the package. 3. Optionally, type `make check’ to run any self-tests that come with the package. 4. Type `make install’ to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean’. To also remove the files that `configure’ created (so you can compile the package for a different kind of computer), type `make distclean’. There is also a `make maintainer-clean’ target, but that is intended mainly for the package’s developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Installation using vcpkg ================== You can build and install yasm using [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager: `git clone https://github.com/Microsoft/vcpkg.git’ `cd vcpkg’ `./bootstrap-vcpkg.sh’ # `./bootstrap-vcpkg.bat’ for Windows `./vcpkg integrate install’ `./vcpkg install yasm’ The yasm port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure’ script does not know about. You can give `configure’ initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env’ program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make’ that supports the `VPATH’ variable, such as GNU `make’. `cd’ to the directory where you want the object files and executables to go and run the `configure’ script. `configure’ automatically checks for the source code in the directory that `configure’ is in and in `..’. If you have to use a `make’ that does not supports the `VPATH’ variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean’ before reconfiguring for another architecture. Installation Names ================== By default, `make install’ will install the package’s files in `/usr/local/bin’, `/usr/local/man’, etc. You can specify an installation prefix other than `/usr/local’ by giving `configure’ the option `—prefix=PATH’. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure’ the option `—exec-prefix=PATH’, the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `—bindir=PATH’ to specify different values for particular kinds of files. Run `configure —help’ for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure’ the option `—program-prefix=PREFIX’ or `—program-suffix=SUFFIX’. Optional Features ================= Some packages pay attention to `—enable-FEATURE’ options to `configure’, where FEATURE indicates an optional part of the package. They may also pay attention to `—with-PACKAGE’ options, where PACKAGE is something like `gnu-as’ or `x’ (for the X Window System). The `README’ should mention any `—enable-‘ and `—with-‘ options that the package recognizes. For packages that use the X Window System, `configure’ can usually find the X include and library files automatically, but if it doesn’t, you can use the `configure’ options `—x-includes=DIR’ and `—x-libraries=DIR’ to specify their locations. Specifying the System Type ========================== There may be some features `configure’ can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure’ can figure that out, but if it prints a message saying it can not guess the host type, give it the `—host=TYPE’ option. TYPE can either be a short name for the system type, such as `sun4′, or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub’ for the possible values of each field. If `config.sub’ isn’t included in this package, then this package doesn’t need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `—target=TYPE’ option to select the type of system they will produce code for and the `—build=TYPE’ option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure’ scripts to share, you can create a site shell script called `config.site’ that gives default values for variables like `CC’, `cache_file’, and `prefix’. `configure’ looks for `PREFIX/share/config.site’ if it exists, then `PREFIX/etc/config.site’ if it exists. Or, you can set the `CONFIG_SITE’ environment variable to the location of the site script. A warning: not all `configure’ scripts look for a site script. Operation Controls ================== `configure’ recognizes the following options to control how it operates. `—cache-file=FILE’ Use and save the results of the tests in FILE instead of `./config.cache’. Set FILE to `/dev/null’ to disable caching, for debugging `configure’. `—help’ Print a summary of the options to `configure’, and exit. `—quiet’ `—silent’ `-q’ Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null’ (any error messages will still be shown). `—srcdir=DIR’ Look for the package’s source code in directory DIR. Usually `configure’ can determine that directory automatically. `—version’ Print the version of Autoconf used to generate the `configure’ script, and exit. `configure’ also accepts some other, not widely useful, options.

Compilation guide for Windows (using Visual Studio and vcpkg)

This guide contains steps required to allow compilation of Cataclysm-BN on Windows using Visual Studio and vcpkg.

Steps from current guide were tested on Windows 10 and 11 (64 bit), Visual Studio 2019 and 2022 (64 bit), but should as well work with slight modifications for other versions of Windows and Visual Studio.

Prerequisites:

  • Computer with modern Windows operating system installed (Windows 10 or 11), Windows 7 and 8.1 are not guaranteed to work;
  • NTFS partition with ~15 Gb free space (~10 Gb for Visual Studio, ~1 Gb for vcpkg installation, ~3 Gb for repository and ~1 Gb for build cache);
  • Git for Windows (installer can be downloaded from Git homepage);
  • Visual Studio 2019 or 2022
    • Note: If you are using Visual Studio 2022, you must install the Visual Studio 2019 compilers to work around a vcpkg bug. In the Visual Studio Installer, select the ‘Individual components’ tab and search for / select the component that looks like ‘MSVC v142 — VS 2019 C++ x64/x86 Build Tools’. See microsoft/vcpkg#22287.
  • Latest version of vcpkg (see instructions on vcpkg homepage).
  • If you plan on contributing your changes to Bright Nights, you’ll also have to install a code formatter, see Code style section for more info.

Note: Windows XP is unsupported!

Installation and configuration:

  1. Install Visual Studio (installer can be downloaded from Visual Studio homepage).
  • Select the «Desktop development with C++» and «Game development with C++» workloads.
  1. Install Git for Windows (installer can be downloaded from Git homepage).

  2. Install and configure latest vcpkg:

WARNING: It is important that, wherever you decide to clone this repo, the path does not include whitespace. That is, C:/dev/vcpkg is acceptable, but C:/dev test/vcpkg is not.

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat -disableMetrics
vcpkg integrate install

Cloning and compilation:

  1. Clone Cataclysm-BN repository with following command line:

Note: This will download the entire CBN repository; 3+ GB of data. If you’re just testing you should probably add --depth=1.

git clone https://github.com/cataclysmbnteam/Cataclysm-BN.git
cd Cataclysm-BN
  1. Open the provided solution (msvc-full-featuresCataclysm-vcpkg-static.sln) in Visual Studio, select configuration (Release is advised if you just want to compile, Debug is if you’re planning on editing code) and platform (x64 or x86) and build it. All necessary dependencies will be built and cached for future use by vcpkg automatically.

  2. Open the Build > Configuration Manager menu and adjust Active solution configuration and Active solution platform to match your intended target.

This will configure Visual Studio to compile the release version, with support for Sound, Tiles, and Localization (note, however, that language files themselves are not automatically compiled; this will be done later).

  1. Start the build process by selecting either Build > Build Solution or Build > Build > Cataclysm-vcpkg-static. The process may take a long period of time, so you’d better prepare a cup of coffee and some books in front of your computer :) The first build of each architecture will also download and install dependencies through vcpkg, which can take an especially long time.

  2. If you want to launch the game directly from Visual Studio, make sure you have specified correct working directory as explained below. Otherwise, you’ll only be able to launch the game from the file explorer.

  3. If you need localization support, execute the bash script lang/compile_mo.sh inside Git Bash GUI just like on a UNIX-like system. This will compile the language files that were not automatically compiled in step 2 above.

Running from Visual Studio and debugging

  1. Ensure that the Cataclysm game binary project (Cataclysm-vcpkg-static) is the selected startup project (right click on it in Solution Explorer -> Set as Startup Project)

  2. Configure the working directory in the project properties to $(ProjectDir).. (right click on it in Solution Explorer -> Properties -> select All Configurations and All Platforms at the top -> Debugging -> Working Directory)

  3. Press the debug button (green right-facing triangle near the top, or use the appropriate shortcut, e.g. F5)

If you discover that after pressing the debug button in Visual Studio, Cataclysm just exits after launch with return code 1, that is because of the wrong working directory.

Debug vs Release builds

Debug builds run significantly slower than Release builds, but provide additional safety checks.

If you just want to build the executable and play the game, Release is advised.

If you plan on editing the code, Debug is advised.

If you have enough experience with C++ to know:

  • under-the-hood differences between Debug and Release
  • how Release optimizations may affect the debugger
  • how to avoid undefined behavior in code

Then you might want to use Release build all the time to speed up dev process, and disable optimizations on a file-by-file basis by adding

#pragma optimize("", off)

line at the top of the file.

Running unit tests

Ensure that the Cataclysm test binary project (Cataclysm-test-vcpkg-static) is the selected startup project, configure the working directory in the project properties to $(ProjectDir).., and then press the debug button (or use the appropriate shortcut, e.g. F5). This will run all of the unit tests. Additional command line arguments may be configured in the project’s command line arguments setting, or if you are using a compatible unit test runner (e.g. Resharper) you can run or debug individual tests from the unit test sessions.

Code style

We use Artistic Style source code formatter to keep the style of our C++ code consistent. While it’s available as pre-built Windows executables, which you could install and run or configure to automatically format the code before commit, a much more convenient option for Visual Studio users is to install a specific extension, see «Astyle extensions for Visual Studio» in doc/DEVELOPER_TOOLING.md for more info.

As of October 2022, the code style check is run automatically on each PR on GitHub, so if you forgot to style your changes you’ll see the corresponsing check failing.

Make a distribution

There is a batch script in msvc-full-features folder distribute.bat. It will create a sub folder distribution and copy all required files(eg. data/, Cataclysm.exe and dlls) into that folder. Then you can zip it and share the archive on the Internet.

Compilation guide for Windows (using Visual Studio and vcpkg)

This guide contains steps required to allow compilation of Cataclysm-BN on Windows using Visual Studio and vcpkg.

Steps from current guide were tested on Windows 10 and 11 (64 bit), Visual Studio 2019 and 2022 (64 bit), but should as well work with slight modifications for other versions of Windows and Visual Studio.

Prerequisites:

  • Computer with modern Windows operating system installed (Windows 10 or 11), Windows 7 and 8.1 are not guaranteed to work;
  • NTFS partition with ~15 Gb free space (~10 Gb for Visual Studio, ~1 Gb for vcpkg installation, ~3 Gb for repository and ~1 Gb for build cache);
  • Git for Windows (installer can be downloaded from Git homepage);
  • Visual Studio 2019 or 2022
    • Note: If you are using Visual Studio 2022, you must install the Visual Studio 2019 compilers to work around a vcpkg bug. In the Visual Studio Installer, select the ‘Individual components’ tab and search for / select the component that looks like ‘MSVC v142 — VS 2019 C++ x64/x86 Build Tools’. See microsoft/vcpkg#22287.
  • Latest version of vcpkg (see instructions on vcpkg homepage).
  • If you plan on contributing your changes to Bright Nights, you’ll also have to install a code formatter, see Code style section for more info.

Note: Windows XP is unsupported!

Installation and configuration:

  1. Install Visual Studio (installer can be downloaded from Visual Studio homepage).
  • Select the «Desktop development with C++» and «Game development with C++» workloads.
  1. Install Git for Windows (installer can be downloaded from Git homepage).

  2. Install and configure latest vcpkg:

WARNING: It is important that, wherever you decide to clone this repo, the path does not include whitespace. That is, C:/dev/vcpkg is acceptable, but C:/dev test/vcpkg is not.

git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat -disableMetrics
vcpkg integrate install

Cloning and compilation:

  1. Clone Cataclysm-BN repository with following command line:

Note: This will download the entire CBN repository; 3+ GB of data. If you’re just testing you should probably add --depth=1.

git clone https://github.com/cataclysmbnteam/Cataclysm-BN.git
cd Cataclysm-BN
  1. Open the provided solution (msvc-full-featuresCataclysm-vcpkg-static.sln) in Visual Studio, select configuration (Release is advised if you just want to compile, Debug is if you’re planning on editing code) and platform (x64 or x86) and build it. All necessary dependencies will be built and cached for future use by vcpkg automatically.

  2. Open the Build > Configuration Manager menu and adjust Active solution configuration and Active solution platform to match your intended target.

This will configure Visual Studio to compile the release version, with support for Sound, Tiles, and Localization (note, however, that language files themselves are not automatically compiled; this will be done later).

  1. Start the build process by selecting either Build > Build Solution or Build > Build > Cataclysm-vcpkg-static. The process may take a long period of time, so you’d better prepare a cup of coffee and some books in front of your computer :) The first build of each architecture will also download and install dependencies through vcpkg, which can take an especially long time.

  2. If you want to launch the game directly from Visual Studio, make sure you have specified correct working directory as explained below. Otherwise, you’ll only be able to launch the game from the file explorer.

  3. If you need localization support, execute the bash script lang/compile_mo.sh inside Git Bash GUI just like on a UNIX-like system. This will compile the language files that were not automatically compiled in step 2 above.

Running from Visual Studio and debugging

  1. Ensure that the Cataclysm game binary project (Cataclysm-vcpkg-static) is the selected startup project (right click on it in Solution Explorer -> Set as Startup Project)

  2. Configure the working directory in the project properties to $(ProjectDir).. (right click on it in Solution Explorer -> Properties -> select All Configurations and All Platforms at the top -> Debugging -> Working Directory)

  3. Press the debug button (green right-facing triangle near the top, or use the appropriate shortcut, e.g. F5)

If you discover that after pressing the debug button in Visual Studio, Cataclysm just exits after launch with return code 1, that is because of the wrong working directory.

Debug vs Release builds

Debug builds run significantly slower than Release builds, but provide additional safety checks.

If you just want to build the executable and play the game, Release is advised.

If you plan on editing the code, Debug is advised.

If you have enough experience with C++ to know:

  • under-the-hood differences between Debug and Release
  • how Release optimizations may affect the debugger
  • how to avoid undefined behavior in code

Then you might want to use Release build all the time to speed up dev process, and disable optimizations on a file-by-file basis by adding

#pragma optimize("", off)

line at the top of the file.

Running unit tests

Ensure that the Cataclysm test binary project (Cataclysm-test-vcpkg-static) is the selected startup project, configure the working directory in the project properties to $(ProjectDir).., and then press the debug button (or use the appropriate shortcut, e.g. F5). This will run all of the unit tests. Additional command line arguments may be configured in the project’s command line arguments setting, or if you are using a compatible unit test runner (e.g. Resharper) you can run or debug individual tests from the unit test sessions.

Code style

We use Artistic Style source code formatter to keep the style of our C++ code consistent. While it’s available as pre-built Windows executables, which you could install and run or configure to automatically format the code before commit, a much more convenient option for Visual Studio users is to install a specific extension, see «Astyle extensions for Visual Studio» in doc/DEVELOPER_TOOLING.md for more info.

As of October 2022, the code style check is run automatically on each PR on GitHub, so if you forgot to style your changes you’ll see the corresponsing check failing.

Make a distribution

There is a batch script in msvc-full-features folder distribute.bat. It will create a sub folder distribution and copy all required files(eg. data/, Cataclysm.exe and dlls) into that folder. Then you can zip it and share the archive on the Internet.

Latest Release: 1.3.0

Release Date: August 10, 2014

  • Yasm 1.3.0 Release Notes
  • Source .tar.gz
  • Win32 VS2010 .zip (for use with VS2010+ on 32-bit Windows)
  • Win64 VS2010 .zip (for use with VS2010+ on 64-bit Windows)
  • Win32 .exe (for general use on 32-bit Windows)
  • Win64 .exe (for general use on 64-bit Windows)
  • CygWin32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

Visual Studio 2010+ Integration

Download the appropriate VS2010 “vsyasm” zip file above for your system, and follow the readme.txt instructions for integrating yasm into Visual Studio 2010 (later versions are similar). Thanks to Brian Gladman for contributing this!

Visual Studio 2005/2008 Integration

See VisualStudio2005 for detailed instructions on integrating Yasm with Visual Studio 2005 (Visual Studio 2008 is similar).

See Structured Exception Handling (part of the Yasm User’s Manual) for detailed information on using structured exception handling in the Windows x64 environment. Yasm also supports the SAFESEH directive for structured exception handling in the Win32 environment.

Nightly Development Snapshots

A complete build of Yasm is performed daily at 1:20 AM PDT if there are any repository changes since the previous day. The latest snapshot is the most recent available. It is updated at the same time as the daily build. A Windows executable is also built nightly as “yasm-{version}.exe” in the latest snapshot directory. Older snapshots are also available.

Git Repository

All Yasm development is taking place using a Git repository. The repository is browseable online.

Yasm’s Git repository is hosted at GitHub and can be checked out with the following command.

git clone git://github.com/yasm/yasm.git

Developers can access the tree via SSH using the following command. A developer account must be set up on GitHub with the proper permissions to the yasm project for write access. You may request a developer account by contacting Peter Johnson.

git clone git@github.com:yasm/yasm.git

Older Releases

1.2.0

Release Date: October 31, 2011

  • Yasm 1.2.0 Release Notes
  • Source .tar.gz
  • Win32 VS2010 .zip (for use with VS2010 on 32-bit Windows)
  • Win64 VS2010 .zip (for use with VS2010 on 64-bit Windows)
  • Win32 .exe (for general use on 32-bit Windows)
  • Win64 .exe (for general use on 64-bit Windows)
  • CygWin32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

1.1.0

Release Date: August 7, 2010

  • Yasm 1.1.0 Release Notes
  • Source .tar.gz
  • Win32 VS2010 .zip (for use with VS2010 on 32-bit Windows)
  • Win64 VS2010 .zip (for use with VS2010 on 64-bit Windows)
  • Win32 .exe (for general use on 32-bit Windows)
  • Win64 .exe (for general use on 64-bit Windows)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

1.0.1

Release Date: May 17, 2010

  • Yasm 1.0.1 Release Notes
  • Source .tar.gz
  • Win32 VS2010 .zip (for use with VS2010 on 32-bit Windows)
  • Win64 VS2010 .zip (for use with VS2010 on 64-bit Windows)
  • Win32 .exe (for general use on 32-bit Windows)
  • Win64 .exe (for general use on 64-bit Windows)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

1.0.0

Release Date: Apr 8, 2010

  • Yasm 1.0.0 Release Notes
  • Source .tar.gz
  • Win32 VS2010 .zip (for use with VS2010 on 32-bit Windows)
  • Win64 VS2010 .zip (for use with VS2010 on 64-bit Windows)
  • Win32 .exe (for general use on 32-bit Windows)
  • Win64 .exe (for general use on 64-bit Windows)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

0.8.0

Release Date: Apr 10, 2009

  • Yasm 0.8.0 Release Notes
  • Source .tar.gz
  • Win32 .exe (for “normal” (Visual Studio or similar) use on 32-bit Windows)
  • Win64 .exe (for “normal” (Visual Studio or similar) use on 64-bit Windows)
  • Win32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

0.7.2

Release Date: Oct 8, 2008

  • Yasm 0.7.2 Release Notes
  • Source .tar.gz
  • Win32 .exe (for “normal” (Visual Studio or similar) use on 32-bit Windows)
  • Win64 .exe (for “normal” (Visual Studio or similar) use on 64-bit Windows)
  • Win32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

0.7.1

Release Date: May 14, 2008

  • Yasm 0.7.1 Release Notes
  • Source .tar.gz
  • Win32 .exe (for “normal” (Visual Studio or similar) use on 32-bit Windows)
  • Win64 .exe (for “normal” (Visual Studio or similar) use on 64-bit Windows)
  • Win32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)
  • Mac .dmg

0.7.0

Release Date: April 16, 2008

  • Yasm 0.7.0 Release Notes
  • Source .tar.gz
  • Win32 .exe (for “normal” (Visual Studio or similar) use on 32-bit Windows)
  • Win64 .exe (for “normal” (Visual Studio or similar) use on 64-bit Windows)
  • Win32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

0.6.2

Release Date: September 21, 2007

  • Yasm 0.6.2 Release Notes
  • Source .tar.gz
  • Win32 .exe (for “normal” (Visual Studio or similar) use on 32-bit Windows)
  • Win64 .exe (for “normal” (Visual Studio or similar) use on 64-bit Windows)
  • Win32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

0.6.1

Release Date: June 5, 2007

  • Yasm 0.6.1 Release Notes
  • Source .tar.gz
  • Win32 .exe (for “normal” (Visual Studio or similar) use on 32-bit Windows)
  • Win64 .exe (for “normal” (Visual Studio or similar) use on 64-bit Windows)
  • Win32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

0.6.0

Release Date: February 24, 2007

  • Yasm 0.6.0 Release Notes
  • Source .tar.gz
  • Win32 .exe (for “normal” (Visual Studio or similar) use on 32-bit Windows)
  • Win64 .exe (for “normal” (Visual Studio or similar) use on 64-bit Windows)
  • Win32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

0.5.0

Release Date: July 12, 2006

  • Yasm 0.5.0 Release Notes
  • Source .tar.gz
  • Win32 .exe (for “normal” (Visual Studio or similar) use on 32-bit Windows)
  • Win64 .exe (for “normal” (Visual Studio or similar) use on 64-bit Windows)
  • Win32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

0.5.0rc2

Release Date: April 6, 2006

  • Yasm 0.5.0rc2 Release Notes
  • Source .tar.gz
  • Win32 .exe (for “normal” (Visual Studio or similar) use on 32-bit Windows)
  • Win64 .exe (for “normal” (Visual Studio or similar) use on 64-bit Windows)
  • Win32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

0.5.0rc1

Release Date: February 11, 2006

  • Yasm 0.5.0rc1 Release Notes
  • Source .tar.gz
  • Win32 .exe (for “normal” (Visual Studio or similar) use on 32-bit Windows)
  • Win64 .exe (for “normal” (Visual Studio or similar) use on 64-bit Windows)
  • Win32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

0.4.0

Release Date: October 31, 2004

  • Yasm 0.4.0 Release Notes
  • Source .tar.gz
  • Win32 .exe (for “normal” (Visual Studio or similar) use)
  • Win32 .exe (for CygWin use)
  • DOS .exe (for use on pure DOS or for use with DJGPP)

0.3.0

Release Date: September 4, 2003

  • 0.3.0 Release Notes
  • yasm-0.3.0.tar.gz
  • DOS (DJGPP) .exe
  • Win32 .exe (built with Visual C++ 6)
  • Win32 .exe (built with GCC on CygWin)

0.2.2

Release Date: June 6, 2003

  • 0.2.2 Release Notes
  • yasm-0.2.2.tar.gz
  • DOS (DJGPP) .exe
  • Win32 .exe (built with Visual C++ 6)
  • Win32 .exe (built with GCC on CygWin)

0.2.1

Release Date: April 1, 2003

  • 0.2.1 Release Notes
  • yasm-0.2.1.tar.gz
  • DOS (DJGPP) .exe
  • Win32 .exe (built with Visual C++ 6)
  • Win32 .exe (built with GCC on CygWin)

0.2.0

Release Date: March 26, 2003

  • 0.2.0 Release Notes
  • yasm-0.2.0.tar.gz
  • DOS (DJGPP) .exe
  • Win32 .exe (built with Visual C++ 6)
  • Win32 .exe (built with GCC on CygWin)

0.1.0

Release Date: March 19, 2002

  • 0.1.0 Release Notes
  • yasm-0.1.0.tar.gz
  • DOS (DJGPP) .exe
  • Win32 .exe (built with Visual C++ 6)

1. Окружающая среда

  • Windows 10(1803)
  • Visual Studio 2017 (набор инструментов VC ++ 2015.3 v140 для настольных ПК (x86, x64))
  • MSYS2(Среда сборки GNU)
  • YASM(компилятор ассемблерного кода x86)
  • gas-preprocessor.pl(Препроцессор компонента ARM)

2. Этапы работы

2.1, установите Visual Studio 2017

Выберите [Install VC ++ 2015.3 v140 desktop toolset (x86, x64)], как показано ниже.

)

2.2, установите MSYS2

  • ссылка на скачивание:http://www.msys2.org/

  • Установите msys2-i686 для 32-битной Windows и msys2-x86_64 для 64-битной Windows.
    Я использую 64 бита.

  • Измените набор rem MSYS2_PATH_TYPE = наследовать, чтобы установить MSYS2_PATH_TYPE = наследовать в msys2_shell.cmd в каталоге MSYS2.
  • Получите последнюю версию make в командном окне MSYS2, команда выглядит следующим образом:
pacman -S make
  • Получите последнюю версию gcc в командном окне MSYS2, команда выглядит следующим образом:
pacman -S gcc
  • Удалите или переименуйте link.exe в msys2 ( usr bin link.exe)
  • Установите perl в командном окне MSYS2, команда выглядит следующим образом:
pacman -S perl
  • Установите diffutils в командном окне MSYS2
pacman -S diffutils
  • Измените свойство Text окна msys2 на GBK, чтобы избежать искаженных символов, отображаемых во время компиляции
    Щелкните окно правой кнопкой мыши, выберите меню [Параметры], выберите [Текст], выберите языковой стандарт: zh_CN и выберите GBK для набора символов.

2.3, установите YASM

  • ссылка на скачивание:http://yasm.tortall.net/Download.html

    Я использую Win64.exe. После загрузки переименуйте загруженный yasm-1.3.0-win64.exe в yasm.exe и поместите его в установочный каталог MSYS2.

2.4, установить газ-препроцессор

  • ссылка на скачивание:https://github.com/FFmpeg/gas-preprocessor
  • Поместите загруженный файл gas-preprocessor.pl в usr bin в каталог установки msys2.

2,5, инструмент проверки

  • Запустите [Командная строка инструмента, совместимого с ARM VS2015 x86]
  • Запустите [C: msys64 msys2_shell.cmd] в окне командной строки.
  • проверка

    $ which cl
    /c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_ARM/cl
    
    $ which link
    /c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_ARM/link
    
    $ which armasm
    /c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_ARM/armasm
    
    $ which yasm
    /usr/bin/yasm
    
    $ which cpp
    /usr/bin/cpp
    
    $ which gas-preprocessor.pl
    /usr/bin/gas-preprocessor.pl

2.6, скачать ffmpeg3.4.2

#Получить код
git clone https://git.ffmpeg.org/ffmpeg.git

# Переключить филиал
git checkout -b release3.4.2 n3.4.2

2.7、Windows 10 x86

  • Запустите [командная строка собственного инструмента VS2015 x86]
  • Запустите [C: msys64 msys2_shell.cmd] в окне командной строки.
  • Войдите в каталог ffmpeg
cd /e/test/ffmpeg
  • Выполните следующие команды в командной строке msys2:

    mkdir -p Output/Windows10/x86
    
    cd Output/Windows10/x86
    
    ../../../configure 
    --toolchain=msvc 
    --disable-programs 
    --disable-d3d11va 
    --disable-dxva2 
    --arch=x86 
    --enable-shared 
    --enable-cross-compile 
    --target-os=win32 
    --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" 
    --extra-ldflags="-APPCONTAINER WindowsApp.lib" 
    --prefix=../../../Build/Windows10/x86
    
    make
    
    make install

2.8、Windows 10 x64

  • Запустите [командная строка собственного инструмента VS2015 x64]
  • Запустите [C: msys64 msys2_shell.cmd] в окне командной строки.
  • Войдите в каталог ffmpeg
cd /e/test/ffmpeg
  • Выполните следующие команды в командной строке msys2:

    mkdir -p Output/Windows10/x64
    
    cd Output/Windows10/x64
    
    ../../../configure 
    --toolchain=msvc 
    --disable-programs 
    --disable-d3d11va 
    --disable-dxva2 
    --arch=x86_64 
    --enable-shared 
    --enable-cross-compile 
    --target-os=win32 
    --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" 
    --extra-ldflags="-APPCONTAINER WindowsApp.lib" 
    --prefix=../../../Build/Windows10/x64
    
    make
    
    make install

2.9、Windows 10 ARM

  • Запустите [командная строка собственного инструмента VS2015 x64]
  • Запустите [C: msys64 msys2_shell.cmd] в окне командной строки.
  • Войдите в каталог ffmpeg
cd /e/test/ffmpeg
  • Выполните следующие команды в командной строке msys2:

    mkdir -p Output/Windows10/ARM
    
    cd Output/Windows10/ARM
    
    ../../../configure 
    --toolchain=msvc 
    --disable-programs 
    --disable-d3d11va 
    --disable-dxva2 
    --arch=arm 
    --as=armasm 
    --cpu=armv7 
    --enable-thumb 
    --enable-shared 
    --enable-cross-compile 
    --target-os=win32 
    --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00 -D__ARM_PCS_VFP" 
    --extra-ldflags="-APPCONTAINER WindowsApp.lib" 
    --prefix=../../../Build/Windows10/ARM
    
    make
    
    make install

PS:

  • Ссылка:https://trac.ffmpeg.org/wiki/CompilationGuide/WinRT

Compile and Use FFmpeg Libraries for Windows Runtime (Windows 10 or Windows 8.1 Apps)

  1. Compile and Use FFmpeg Libraries for Windows Runtime (Windows 10 or …
  2. Prerequisites and First Time Setup Instructions

    1. Prerequisites
    2. Verifying your FFmpeg Environment Setup
  3. Compiling for Windows 10

    1. Windows 10 x86
    2. Windows 10 x64
    3. Windows 10 ARM
  4. Compiling for Windows 8.1

    1. Windows Store 8.1 x86 (Windows 8.1 Win32 in Visual Studio)
    2. Windows Store 8.1 x64 (Windows 8.1 x64 in Visual Studio)
    3. Windows Store 8.1 ARM (Windows 8.1 ARM in Visual Studio)
    4. Windows Phone 8.1 x86 (Windows Phone 8.1 Win32 Emulator in Visual Studio)
    5. Windows Phone 8.1 ARM (Windows Phone 8.1 ARM Device in Visual Studio)
  5. Troubleshooting
  6. Windows Store Certification, File I/O, and Other Details
  7. Verifying Built FFmpeg Libraries and Sample Applications

FFmpeg libraries can be built and used for Windows Apps development targeting Windows 10, Windows 8.1, and Windows Phone 8.1. The guide below provides build instruction for all supported target configurations (platform & architecture). Each configuration requires distinct set of tools, environment variables, and configure options outlined in each section below. It concludes with some practical and potentially non-obvious information for consuming the FFmpeg DLLs from your app.


Prerequisites and First Time Setup Instructions

Prerequisites

  • For Windows 10: Microsoft Visual Studio 2015 (tested with Visual Studio 2015 RTM)
  • For Windows 8.1: Microsoft Visual Studio 2013 (use MSVC 2013 Update 3 RTM or newer)
  • MSYS2 (GNU Make environment)
  • YASM (x86 assembly code compiler)
  • gas-preprocessor.pl (ARM assembly pre-processor)

Windows 10 Setup

Download and install Microsoft Visual Studio 2015 on a Windows 10 machine.

Windows 8.1 Setup

Download and install Microsoft Visual Studio 2013 on a Windows 8.1 machine

MSYS2 Setup

Download the latest MSYS2 installer from http://msys2.github.io/ and follow the installation instruction closely from the installation webpage.
In order for the environment from the Windows side to be inherited on the MSYS2 side, uncomment the following line from msys2_shell.cmd if it is present:
replace rem set MSYS2_PATH_TYPE=inherit
with set MSYS2_PATH_TYPE=inherit this will allow the environment variables for Visual Studio to be transferred to the MSYS2 environment and back.

Once base MSYS2 is successfully installed, get the latest make package by invoking the following command in your MSYS2 shell

pacman -S make

Also get the latest gcc package

pacman -S gcc

Rename or remove link.exe in the MSYS2 usr bin folder (E.g. C:msys64usrbinlink.exe) to prevent conflict with MSVC link.exe

Install perl as it will be needed to run ‘gas-preprocessor.pl’

pacman -S perl

Install also diffutils for configure script

pacman -S diffutils

YASM Setup

Download YASM executable from http://yasm.tortall.net/Download.html. You have to download the «general use» binaries and NOT the ones for VS2010. Either Win32 or Win64 binaries support outputting object files for both architectures so that should not matter. The last tested version was yasm-1.3.0-win64.exe.

Rename the downloaded executable to yasm.exe and place it in your MSYS2 path. E.g.C:msys64usrbinyasm.exe.

gas-preprocessor Setup

Download gas-preprocessor.pl Perl script from https://github.com/FFmpeg/gas-preprocessor

Place the downloaded Perl script in your MSYS2 path. E.g. C:msys64usrbingas-preprocessor.pl

Verifying your FFmpeg Environment Setup

Launch Visual Studio ARM Cross Tools Command Prompt. E.g.

C:ProgramDataMicrosoftWindowsStart MenuProgramsVisual Studio 2015Visual Studio ToolsWindows Desktop Command PromptsVS2015 x86 ARM Cross Tools Command Prompt

Open MSYS2 Shell from the command prompt above (use the correct drive and location of your MSYS2 installation). Note that the command shell above will close and it may take a while for the MSYS2 shell to launch.

C:msys64msys2_shell.cmd

In the MSYS2 shell verify that all the tools below are setup properly by running the following commands

$ which cl
/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_ARM/cl

$ which link
/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_ARM/link

$ which armasm
/c/Program Files (x86)/Microsoft Visual Studio 14.0/VC/BIN/x86_ARM/armasm

$ which yasm
/usr/bin/yasm

$ which cpp
/usr/bin/cpp

$ which gas-preprocessor.pl
/usr/bin/gas-preprocessor.pl

Verify that the tools are in the path and point to the right location where MSYS2 and Visual Studio are installed


To keep the source tree clean and the platforms separated, we will have the intermediate files go to the Output<Platform><Architecture> folder under the FFmpeg source tree. We will also have the install files (the files necessary to link and use FFmpeg in your application) go to the Build<Platform><Architecture> folder under the FFmpeg source tree.


Compiling for Windows 10

Windows 10 x86

Launch VS2015 x86 Native Tools Command Prompt. E.g.

C:ProgramDataMicrosoftWindowsStart MenuProgramsVisual Studio 2015Visual Studio ToolsWindows Desktop Command PromptsVS2015 x86 Native Tools Command Prompt

Set the following environment variables in the launched command prompt above

SET LIB=%VSINSTALLDIR%VClibstore;%VSINSTALLDIR%VCatlmfclib;%UniversalCRTSdkDir%lib%UCRTVersion%ucrtx86;;%UniversalCRTSdkDir%lib%UCRTVersion%umx86;C:Program Files (x86)Windows KitsNETFXSDK4.6libumx86;;C:Program Files (x86)Windows KitsNETFXSDK4.6Libumx86
SET LIBPATH=%VSINSTALLDIR%VCatlmfclib;%VSINSTALLDIR%VClib;
SET INCLUDE=%VSINSTALLDIR%VCinclude;%VSINSTALLDIR%VCatlmfcinclude;%UniversalCRTSdkDir%Include%UCRTVersion%ucrt;%UniversalCRTSdkDir%Include%UCRTVersion%um;%UniversalCRTSdkDir%Include%UCRTVersion%shared;%UniversalCRTSdkDir%Include%UCRTVersion%winrt;C:Program Files (x86)Windows KitsNETFXSDK4.6Includeum;

Open MSYS2 Shell from the command prompt above (use the correct drive and location of your MSYS2 installation). Note that the command shell above will close and it may take a while for the MSYS2 shell to launch.

C:msys64msys2_shell.cmd

In your MSYS2 shell navigate to your cloned FFmpeg folder. E.g.

cd /c/ffmpeg

Invoke the following make commands

mkdir -p Output/Windows10/x86

cd Output/Windows10/x86

../../../configure 
--toolchain=msvc 
--disable-programs 
--disable-d3d11va 
--disable-dxva2 
--arch=x86 
--enable-shared 
--enable-cross-compile 
--target-os=win32 
--extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" 
--extra-ldflags="-APPCONTAINER WindowsApp.lib" 
--prefix=../../../Build/Windows10/x86

make

make install

Generated libraries can be found in Build/Windows10/x86 folder specified in --prefix option above


Windows 10 x64

Launch VS2015 x86 x64 Cross Tools Command Prompt. E.g.

C:ProgramDataMicrosoftWindowsStart MenuProgramsVisual Studio 2015Visual Studio ToolsWindows Desktop Command PromptsVS2015 x86 x64 Cross Tools Command Prompt

Set the following environment variables in the launched command prompt above

SET LIB=%VSINSTALLDIR%VClibstoreamd64;%VSINSTALLDIR%VCatlmfclibamd64;%UniversalCRTSdkDir%lib%UCRTVersion%ucrtx64;;%UniversalCRTSdkDir%lib%UCRTVersion%umx64;C:Program Files (x86)Windows KitsNETFXSDK4.6libumx64;;C:Program Files (x86)Windows KitsNETFXSDK4.6Libumx64
SET LIBPATH=%VSINSTALLDIR%VCatlmfclibamd64;%VSINSTALLDIR%VClibamd64;
SET INCLUDE=%VSINSTALLDIR%VCinclude;%VSINSTALLDIR%VCatlmfcinclude;%UniversalCRTSdkDir%Include%UCRTVersion%ucrt;%UniversalCRTSdkDir%Include%UCRTVersion%um;%UniversalCRTSdkDir%Include%UCRTVersion%shared;%UniversalCRTSdkDir%Include%UCRTVersion%winrt;C:Program Files (x86)Windows KitsNETFXSDK4.6Includeum;

Open MSYS2 Shell from the command prompt above (use the correct drive and location of your MSYS2 installation). Note that the command shell above will close and it may take a while for the MSYS2 shell to launch.

C:msys64msys2_shell.cmd

In your MSYS2 shell navigate to your cloned FFmpeg folder. E.g.

cd /c/ffmpeg

Invoke the following make commands

mkdir -p Output/Windows10/x64

cd Output/Windows10/x64

../../../configure 
--toolchain=msvc 
--disable-programs 
--disable-d3d11va 
--disable-dxva2 
--arch=x86_64 
--enable-shared 
--enable-cross-compile 
--target-os=win32 
--extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" 
--extra-ldflags="-APPCONTAINER WindowsApp.lib" 
--prefix=../../../Build/Windows10/x64

make

make install

Generated libraries can be found in Build/Windows10/x64 folder specified in --prefix option above

If you encounter an error linking because link.exe complains that MSPDB140.dll has the wrong version installed. Run the following command from an administrative command-prompt and rebuild:

copy "C:Program Files (x86)Microsoft Visual Studio 14.0VCbinmspdbsrv.exe" "C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDE"

Windows 10 ARM

Launch VS2015 x86 ARM Cross Tools Command Prompt. E.g.

C:ProgramDataMicrosoftWindowsStart MenuProgramsVisual Studio 2015Visual Studio ToolsWindows Desktop Command PromptsVS2015 x86 ARM Cross Tools Command Prompt

Set the following environment variables in the launched command prompt above

SET LIB=%VSINSTALLDIR%VClibstoreARM;%VSINSTALLDIR%VCatlmfclibARM;%UniversalCRTSdkDir%lib%UCRTVersion%ucrtarm;;%UniversalCRTSdkDir%lib%UCRTVersion%umarm;C:Program Files (x86)Windows KitsNETFXSDK4.6libumarm;;C:Program Files (x86)Windows KitsNETFXSDK4.6Libumarm
SET LIBPATH=%VSINSTALLDIR%VCatlmfclibARM;%VSINSTALLDIR%VClibARM;
SET INCLUDE=%VSINSTALLDIR%VCinclude;%VSINSTALLDIR%VCatlmfcinclude;%UniversalCRTSdkDir%Include%UCRTVersion%ucrt;%UniversalCRTSdkDir%Include%UCRTVersion%um;%UniversalCRTSdkDir%Include%UCRTVersion%shared;%UniversalCRTSdkDir%Include%UCRTVersion%winrt;C:Program Files (x86)Windows KitsNETFXSDK4.6Includeum;

Open MSYS2 Shell from the command prompt above (use the correct drive and location of your MSYS2 installation). Note that the command shell above will close and it may take a while for the MSYS2 shell to launch.

C:msys64msys2_shell.cmd

In your MSYS2 shell navigate to your cloned FFmpeg folder. E.g.

cd /c/ffmpeg

Invoke the following make commands

mkdir -p Output/Windows10/ARM

cd Output/Windows10/ARM

../../../configure 
--toolchain=msvc 
--disable-programs 
--disable-d3d11va 
--disable-dxva2 
--arch=arm 
--as=armasm 
--cpu=armv7 
--enable-thumb 
--enable-shared 
--enable-cross-compile 
--target-os=win32 
--extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00 -D__ARM_PCS_VFP" 
--extra-ldflags="-APPCONTAINER WindowsApp.lib" 
--prefix=../../../Build/Windows10/ARM

make

make install

Generated libraries can be found in Build/Windows10/ARM folder specified in --prefix option above

If you encounter an error linking because link.exe complains that MSPDB140.dll has the wrong version installed. Run the following command from an administrative command-prompt and rebuild:

copy "C:Program Files (x86)Microsoft Visual Studio 14.0VCbinmspdbsrv.exe" "C:Program Files (x86)Microsoft Visual Studio 14.0Common7IDE"

Compiling for Windows 8.1

Windows Store 8.1 x86 (Windows 8.1 Win32 in Visual Studio)

Launch Developer Command Prompt for VS2013

Start Menu > Visual Studio 2013 (Start Menu Folder) > Visual Studio Tools > Developer Command Prompt for VS2013

Set the following environment variables in the launched command prompt above. These environment variables overwrite the default paths with correct target specific ones.

SET LIB=%VSINSTALLDIR%VClibstore;%VSINSTALLDIR%VCatlmfclib;%WindowsSdkDir%libwinv6.3umx86;;
SET LIBPATH=%WindowsSdkDir%ReferencesCommonConfigurationNeutral;;%VSINSTALLDIR%VCatlmfclib;%VSINSTALLDIR%VClib;
SET INCLUDE=%VSINSTALLDIR%VCinclude;%VSINSTALLDIR%VCatlmfcinclude;%WindowsSdkDir%Includeum;%WindowsSdkDir%Includeshared;%WindowsSdkDir%Includewinrt;;

Open MSYS2 Shell from the command prompt above (use the correct drive and location of your MSYS2 installation). Note that the command shell above will close and it may take a while for the MSYS2 shell to launch.

C:msys64msys2_shell.cmd

In your MSYS2 shell navigate to your cloned FFmpeg folder. E.g.

cd /c/ffmpeg

Invoke the following make commands

mkdir -p Output/Windows8.1/x86

cd Output/Windows8.1/x86

../../../configure 
--toolchain=msvc 
--disable-programs 
--disable-dxva2 
--arch=x86 
--enable-shared 
--enable-cross-compile 
--target-os=win32 
--extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP -D_WIN32_WINNT=0x0603" 
--extra-ldflags="-APPCONTAINER" 
--prefix=../../../Build/Windows8.1/x86

make

make install

Generated libraries can be found in Build/Windows8.1/x86 folder specified in --prefix option above


Windows Store 8.1 x64 (Windows 8.1 x64 in Visual Studio)

Launch VS2013 x64 Cross Tools Command Prompt

Start Menu > Visual Studio 2013 (Start Menu Folder) > Visual Studio Tools > VS2013 x64 Cross Tools Command Prompt

Set the following environment variables in the launched command prompt above. These environment variables overwrite the default paths with correct target specific ones.

SET LIB=%VSINSTALLDIR%VClibstoreamd64;%VSINSTALLDIR%VCatlmfclibamd64;%WindowsSdkDir%libwinv6.3umx64;;
SET LIBPATH=%WindowsSdkDir%ReferencesCommonConfigurationNeutral;;%VSINSTALLDIR%VCatlmfclibamd64;%VSINSTALLDIR%VClibamd64;
SET INCLUDE=%VSINSTALLDIR%VCinclude;%VSINSTALLDIR%VCatlmfcinclude;%WindowsSdkDir%Includeum;%WindowsSdkDir%Includeshared;%WindowsSdkDir%Includewinrt;;

Open MSYS2 Shell from the command prompt above (use the correct drive and location of your MSYS2 installation). Note that the command shell above will close and it may take a while for the MSYS2 shell to launch.

C:msys64msys2_shell.cmd

In your MSYS2 shell navigate to your cloned FFmpeg folder. E.g.

cd /c/ffmpeg

Invoke the following make commands

mkdir -p Output/Windows8.1/x64

cd Output/Windows8.1/x64

../../../configure 
--toolchain=msvc 
--disable-programs 
--disable-dxva2 
--arch=x86_64 
--enable-shared 
--enable-cross-compile 
--target-os=win32 
--extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP -D_WIN32_WINNT=0x0603" 
--extra-ldflags="-APPCONTAINER" 
--prefix=../../../Build/Windows8.1/x64

make

make install

Generated libraries can be found in Build/Windows8.1/x64 folder specified in --prefix option above


Windows Store 8.1 ARM (Windows 8.1 ARM in Visual Studio)

Launch VS2013 ARM Cross Tools Command Prompt

Start Menu > Visual Studio 2013 (Start Menu Folder) > Visual Studio Tools > VS2013 ARM Cross Tools Command Prompt

Set the following environment variables in the launched command prompt above. These environment variables overwrite the default paths with correct target specific ones.

SET LIB=%VSINSTALLDIR%VClibstoreARM;%VSINSTALLDIR%VCatlmfclibARM;%WindowsSdkDir%libwinv6.3umarm;;
SET LIBPATH=%WindowsSdkDir%ReferencesCommonConfigurationNeutral;;%VSINSTALLDIR%VCatlmfclibARM;%VSINSTALLDIR%VClibARM;
SET INCLUDE=%VSINSTALLDIR%VCinclude;%VSINSTALLDIR%VCatlmfcinclude;%WindowsSdkDir%Includeum;%WindowsSdkDir%Includeshared;%WindowsSdkDir%Includewinrt;;

Open MSYS2 Shell from the command prompt above (use the correct drive and location of your MSYS2 installation). Note that the command shell above will close and it may take a while for the MSYS2 shell to launch.

C:msys64msys2_shell.cmd

In your MSYS2 shell navigate to your cloned FFmpeg folder. E.g.

cd /c/ffmpeg

Invoke the following make commands

mkdir -p Output/Windows8.1/ARM

cd Output/Windows8.1/ARM

../../../configure 
--toolchain=msvc 
--disable-programs 
--disable-d3d11va 
--disable-dxva2 
--arch=arm 
--as=armasm 
--cpu=armv7 
--enable-thumb 
--enable-shared 
--enable-cross-compile 
--target-os=win32 
--extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP -D_WIN32_WINNT=0x0603 -D__ARM_PCS_VFP" 
--extra-ldflags="-APPCONTAINER -MACHINE:ARM" 
--prefix=../../../Build/Windows8.1/ARM

make

make install

Generated libraries can be found in Build/Windows8.1/ARM folder specified in --prefix option above


Windows Phone 8.1 x86 (Windows Phone 8.1 Win32 Emulator in Visual Studio)

Launch Developer Command Prompt for VS2013

Start Menu > Visual Studio 2013 (Start Menu Folder) > Visual Studio Tools > Developer Command Prompt for VS2013

Set the following environment variables in the launched command prompt above. These environment variables overwrite the default paths with correct target specific ones.

SET LIB=%VSINSTALLDIR%VClibstore;%VSINSTALLDIR%VCatlmfclib;%WindowsSdkDir%....Windows Phone Kits8.1libx86;;
SET LIBPATH=%VSINSTALLDIR%VCatlmfclib;%VSINSTALLDIR%VClib
SET INCLUDE=%VSINSTALLDIR%VCINCLUDE;%VSINSTALLDIR%VCATLMFCINCLUDE;%WindowsSdkDir%....Windows Phone Kits8.1Include;%WindowsSdkDir%....Windows Phone Kits8.1Includeabi;%WindowsSdkDir%....Windows Phone Kits8.1Includemincore;%WindowsSdkDir%....Windows Phone Kits8.1Includeminwin;%WindowsSdkDir%....Windows Phone Kits8.1Includewrl;

Open MSYS2 Shell from the command prompt above (use the correct drive and location of your MSYS2 installation). Note that the command shell above will close and it may take a while for the MSYS2 shell to launch.

C:msys64msys2_shell.cmd

In your MSYS2 shell navigate to your cloned FFmpeg folder. E.g.

cd /c/ffmpeg

Invoke the following make commands

mkdir -p Output/WindowsPhone8.1/x86

cd Output/WindowsPhone8.1/x86

../../../configure 
--toolchain=msvc 
--disable-programs 
--disable-d3d11va 
--disable-dxva2 
--arch=x86 
--enable-shared 
--enable-cross-compile 
--target-os=win32 
--extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -D_WIN32_WINNT=0x0603" 
--extra-ldflags="-APPCONTAINER -subsystem:console -opt:ref WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib -NODEFAULTLIB:kernel32.lib -NODEFAULTLIB:ole32.lib" 
--prefix=../../../Build/WindowsPhone8.1/x86

make

make install

Generated libraries can be found in Build/WindowsPhone8.1/x86 folder specified in --prefix option above


Windows Phone 8.1 ARM (Windows Phone 8.1 ARM Device in Visual Studio)

Launch VS2013 ARM Cross Tools Command Prompt

Start Menu > Visual Studio 2013 (Start Menu Folder) > Visual Studio Tools > VS2013 ARM Cross Tools Command Prompt

Set the following environment variables in the launched command prompt above. These environment variables overwrite the default paths with correct target specific ones.

SET LIB=%VSINSTALLDIR%VClibstoreARM;%VSINSTALLDIR%VCatlmfclibARM;%WindowsSdkDir%....Windows Phone Kits8.1libarm;;
SET LIBPATH=%VSINSTALLDIR%VCatlmfclibARM;%VSINSTALLDIR%VClibARM
SET INCLUDE=%VSINSTALLDIR%VCinclude;%VSINSTALLDIR%VCatlmfcinclude;%WindowsSdkDir%....Windows Phone Kits8.1Include;%WindowsSdkDir%....Windows Phone Kits8.1Includeabi;%WindowsSdkDir%....Windows Phone Kits8.1Includemincore;%WindowsSdkDir%....Windows Phone Kits8.1Includeminwin;%WindowsSdkDir%....Windows Phone Kits8.1Includewrl;

Open MSYS2 Shell from the command prompt above (use the correct drive and location of your MSYS2 installation). Note that the command shell above will close and it may take a while for the MSYS2 shell to launch.

C:msys64msys2_shell.cmd

In your MSYS2 shell navigate to your cloned FFmpeg folder. E.g.

cd /c/ffmpeg

Invoke the following make commands

mkdir -p Output/WindowsPhone8.1/ARM

cd Output/WindowsPhone8.1/ARM

../../../configure 
--toolchain=msvc 
--disable-programs 
--disable-d3d11va 
--disable-dxva2 
--arch=arm 
--as=armasm 
--cpu=armv7 
--enable-thumb 
--enable-shared 
--enable-cross-compile 
--target-os=win32 
--extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -D_WIN32_WINNT=0x0603 -D__ARM_PCS_VFP" 
--extra-ldflags="-APPCONTAINER -MACHINE:ARM -subsystem:console -opt:ref WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib -NODEFAULTLIB:kernel32.lib -NODEFAULTLIB:ole32.lib" 
--prefix=../../../Build/WindowsPhone8.1/ARM

make

make install

Generated libraries can be found in Build/WindowsPhone8.1/ARM folder specified in --prefix option above


Troubleshooting

Building ARM libraries using Visual Studio armasm ARM assembler requires proper setup of gas-preprocessor.pl and Perl in your MSYS2 environment. Please follow the setup instruction closely.


Windows Store Certification, File I/O, and Other Details

FFmpeg is an excellent alternative to Windows Media Foundation, which supports a small fraction of the codecs that FFmpeg has. Fortunately,
FFmpeg does not use any prohibited Windows or CRT APIs, and apps linked to the DLLs built with this method pass the latest Windows App Certification Kit. However, there are important things to remember.

First, don’t forget to make sure your app package includes all the necessary FFmpeg DLLs in the root folder. In your Visual C++ project, you should include links to the FFmpeg DLLs in the root project folder, making sure to set «Build Action» to «Content» and «Copy to Output Directory» to «Copy Always». It is not enough just to link to the import libraries. You will fail certification if you require your users to install the FFmpeg DLLs separately.

You will also need to supply a custom file I/O context to any AVFormatContext rather than relying on avio_xxx functions, because the standard I/O functions utilize CRT I/O that is not supported in WinRT. (You won’t fail certification, but your app will be unable to access the file specified in the AVFormatContext.filename member, unless potentially it is located in the app’s local storage). The file I/O context needs to be initialized to point to your read, write, and seek functions, with the opaque member pointing to a struct containing an IRandomAccessStream^ that you obtain when opening a file using proper WinRT IO calls in the Windows::Storage namespace. (You need a struct to hold the IRandomAccessStream^, since you cannot cast a void* to a ref handle). Your read, write, and seek functions should cast the void* opaque argument to the struct* you define, and then use the IRandomAccessStream^ for all I/O.

Since FFmpeg I/O calls are synchronous, but the IRandomAccessStream members are all asynchronous, you will need to utilize create_task and wait() on all I/O calls in your IO context implementation functions. Note that this necessitates that any FFmpeg functions utilizing file I/O be executed on a WORKER thread, as WinRT will generate an exception if you use wait() in the UI thread. The best solution here is to create WinRT-friendly wrapper functions of the major FFmpeg functions you will utilize, by using the concurrency::create_async function, for example:

IAsyncOperation<int>^ av_read_frame_async(AVFormatContext* s, AVPacket* pkt)
{
	return create_async([s, pkt]()->int
	{
		return av_read_frame(s, pkt);
	});
}

Alternatively, if you don’t want to use Windows Runtime extensions, and don’t mind COM, you can use the Windows 8-API function CreateStreamOverRandomAccessStream, which gives you an IStream* COM interface from an IRandomAccessStream^, utilizes synchronous I/O, and can be passed as the void* opaque member of the IO context. The IStream I/O calls are easier to use with C++ since they support direct pointer buffer access (you don’t have to deal with IBuffer) and more closely correspond to the functions required in AVIOContext. However, you should still make sure to wrap any code that utilizes file I/O in a background thread, as excessive blocking of the UI does violate Windows Store guidelines and may cause your app to be terminated at runtime.


Verifying Built FFmpeg Libraries and Sample Applications

The generated FFmpeg libraries from the compilation above can be consumed by Windows Runtime Components or Apps. They can be tested against the interop component and sample media players in the following project:

https://github.com/Microsoft/FFmpegInterop

Понравилась статья? Поделить с друзьями:
  • Как установить xubuntu рядом с windows
  • Как установить xps viewer в windows 7
  • Как установить xnview по умолчанию в windows 10
  • Как установить xlrd python 3 на windows
  • Как установить xerox workcentre 3045 на windows 10