FFMPEG build error - build

I've been trying to build a LGPL copy of ffmpeg and I have tried various different configure methods. I downloaded the latest source from the ffmpeg site and used the following simple configure
./configure --enable-memalign-hack --enable-pthreads --enable-shared --disable-static
However every time I try to build it I only end up with "avdevice-53.dll" and the error message like this
install: cannot stat 'libavdevice/avdevice.lib' : No such file or directory
make: *** [install-libavdevice-shared] Error 1
What am I doing wrong?

I think it should be safe to ignore that error? Have you checked the source folder in the corresponding folders for the dll files?
e.g. avcodec.dll - source folder/libavcodec

I fix this problem with wine. This is handy if you need to build ffmpeg on Linux for Visual Studio target.
First, you need to get lib.exe, link.exe, mspdb100.dll and msvcr100.dll files form Visual Studio installation path.
Rename to lib.exe to lib_vs.exe. And create a script file lib.exe calling lib_vs.exe:
#!/bin/bash
wine lib_vs.exe
Put all these files in you're build directory and set PATH able to find it.
I share the script i use to do that:
#!/bin/bash
(
export PATH=.:$PATH
rm -rf build
mkdir build
cd build
cp ../lib.exe .
cp ../lib_vs.exe .
cp ../link.exe .
cp ../ms*.dll .
../src/configure --enable-memalign-hack --arch=x86 --target-os=mingw32 --cross-prefix=i686-w64-mingw32- --enable-shared --prefix=../release --pkg-config=pkg-config
make && make install
cd ..
)

Related

could not find "vswhere"

I'm trying to install boost to run PyGMO properly. However, after I unpack it in a directory (did not use git).
After running bootstrap vc142 (I'm using VScode V1.63.2 and I'm on windows). I'm getting this error:
Building Boost.Build engine
LOCALAPPDATA=C:\Users\wojci\AppData\Local
could not find "vswhere"
Call_If_Exists "..\bin\VCVARS32.BAT"
###
### Using 'msvc' toolset.
###
Followed by:
C:\Program Files\boost\boost_1_78_0\tools\build\src\engine>dir *.exe
Volume in drive C has no label.
C:\Program Files\boost\boost_1_78_0\tools\build\src\engine>copy /b .\b2.exe .\bjam.exe
The system cannot find the file specified.
Failed to build Boost.Build engine.
Does anyone know how to fix/work around this?
Thank you in advance
I found the solution here (git)
Prerequisites:
First download and install MinGW installer mingw-w64-install.exe (I fot it from Sourceforge) and make sure you use x86_64 architecture.
Then download the boost file (boost_1_78_0.zip source)
Open and run cmd as admin
Enter the following command to link the MinFW folder in C:\
mklink /J C:\MinGW "C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64"
add MinGW to the system PATH:
set PATH=%PATH%;C:\MinGW\bin
setx /M PATH "%PATH%"
Check if you have at least g++ version of 8.1.0
g++ --version
Methodology to install boost:
Navigate to the install folder created and unzip and extract the boost_1_78_0.zip file into this folder
In the CMD navigated to the boost folder
cd C:\install\boost_1_78_0
Type the following to make directories for building and installing boost
mkdir C:\boost-build
mkdir C:\install\boost_1_78_0\boost-build
mkdir C:\boost
Setup boost.build (second line prepers b2, the third line builds boost.build with b2, and the fourth line adds C:\boost-build\bin to your session PATH variable)
cd C:\install\boost_1_78_0\tools\build
bootstrap.bat gcc
b2 --prefix="C:\boost-build" install
set PATH=%PATH%;C:\boost-build\bin
building boost (first line navigateds to boost directory, second line builds boost with b2 this can take a while)
cd C:\install\boost_1_78_0
b2 --build-dir="C:\install\boost_1_78_0\build" --build-type=complete --prefix="C:\boost" toolset=gcc install
Extra notes:
This should work for boost 1.68.0 too and might work for other version just replace 1_78_0 with 1_68_0.
At the end you should have three lines that look something like this:
...failed updating 72 targets...
...skipped 292 targets...
...updated 22164 targets...
It's totally fine if you have some failed and skipped files.
Type "native tools " in the start search.
Run "Native tools for visual studio" as an administrator. A command prompt opens.
change directory to boost .
run command "bootstrap".
Follow up by ".\b2".
Wait for a while.
Worked for me. Hope it helps.

Getting error "libbrotli needed" when compiling woff2

I am trying to compile google/woff2 for 3 days but getting error "libbrotli needed". I was able compile brotli by running CMakeLists.txt in brotli folder and got .so files. I am beginner so I don't know to link both together. I want to compile and add brotli from CMakeLists.txt in woff2 folder or at least somehow compile linux build for woff2.
Thanks
It seems like you need to compile and install brotli on your machine before you can compile google/woff2. The installation process is actually copying the .so and header file to somewhere on your system path that CMake is able to find it.
For example, you can you use this command to install the library to "/home/myuser/installdir"
cmake --install . --prefix "/home/myuser/installdir"
Build woff2 with libbrotli included in the executable
woff2/README.md says:
git clone --recursive https://github.com/google/woff2.git && cd woff2/ && make clean all
I.e. the woff2 executable´s can be built and used in the woff2/ directory, or can be copied to any location.
cd new-Folder/
git clone --recursive
https://github.com/google/woff2.git
cd woff2/
make clean all ## brotli libs and woff2 are built ... together
## executable: {woff2_compress, woff2_decompress, woff2_info}
## compress example
./woff2_compress satluj.ttf
Processing satluj.ttf => satluj.woff2
Compressed 45526 to 21423.
P.S.: Many of the "Linux OS" have woff2 (and libbrotli) available as a package, name = woff2 or woff2-tools.

How do I build a C++ project using Eclipse CDT?

I cloned a git repository from github (a project called plumed) and in order to install it I used to execute the following commands from the terminal:
> ./configure --enable-debug
> make -j 4
> make install
After that checking that everything was ok I used to execute the command
> which plumed
> /usr/local/plumed
How can I do the same from Eclipse?
Building from eclipse looks like to execute the command "make all" that returns errors.
Here is what I do, hope it helps.
I make a build directory, cd into that and run configure from there. That will produce a Makefile in the build directory. Then I create a Makefile project in eclipse. Open the Makefile. Then, on the right hand side, in the Outline window you can select the make targets you want to use (all, clean, install, uninstall ...).
You can make several build directories for different configurations (build-debug, build-release etc...).
In fact I have a script for each build type that sets various build flags and calls configure with the relevant flags:
#!/bin/bash
top_dir=$(pwd)
PREFIX=${PREFIX:-$HOME/dev}
LIBDIR=$PREFIX/lib
WITH="$WITH --with-mysql=yes"
WITH="$WITH --with-speller=yes"
export PKG_CONFIG_PATH="$LIBDIR/pkgconfig"
export CXXFLAGS="-g3 -O0 -D DEBUG"
rm -fr $top_dir/build-debug
mkdir -p $top_dir/build-debug
cd $top_dir/build-debug
$top_dir/configure $WITH --prefix=$PREFIX
In eclipse I always make the --prefix point to install within the $HOME folders so you don't need root privilege to install everything.

Building libcsv problems

I'm having some trouble building the csv library libcsv.
I'm using Windows XP, MinGW compiler and MSYS command shell.
It configures ok (./configure) but when I go to build it I get the below error. I realise it has to do with autoconf (it requires 2.65 or above) So what do I do here. Do I download autoconf and have it in a separate directory marked c:\autoconf and have an environmental variable pointing to it? Or,, does it go in the MSYS folder.
I have downloaded the binaries for autoconf and I just get a bunch of files. The binary files are in a SHARE folder and a 'bin' folder. Do I put their contents into the MsYS share and bin folders? Looking around the web I'm also seeing references to putting the autoconf binaries into my MinGW/bin folder. I'm really not sure what to do here?
Can anyone help? Thank you.
xxxx#XXXX-2FEF09FD39 ~
$ cd C:\libcsv-3.0.3
xxxx#XXXX-2FEF09FD39 /c/libcsv-3.0.3
$ make
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /c/libcsv-3.0.3/missing --run autoconf
/bin/m4: unrecognized option `--gnu'
Try `/bin/m4 --help' for more information.
autom4te: /bin/m4 failed with exit status: 1
make: *** [configure] Error 1
xxxx#XXXX-2FEF09FD39 /c/libcsv-3.0.3
$

How to build boost iostreams with gzip and bzip2 support on Windows

How do I build boost's iostreams library with gzip and bzip2 support?
I am no expert, but this worked for me.
Option 1 (straight from source)
Download source files for zlib and for bzip2.
Extract the downloads to directories, move directories to somewhere you like. I had to avoid C:\Program Files (x86)\ as I couldn't get it to work with spaces in the directory name, so I created C:\Sys\ and used that.
Open a command prompt with elevated privileges (run as administrator), go to your boost directory, e.g. C:\Program Files (x86)\boost\boost_1_50_0\ and type b2.exe --with-iostreams -s BZIP2_SOURCE=C:\Sys\bzip2-1.0.6 -s ZLIB_SOURCE=C:\Sys\zlib-1.2.7
Verify that C:\Program Files (x86)\boost\boost_1_50_0\stage\lib contains the wanted files, e.g. libboost_zlib-vc100-*-1_50 and libboost_bzip2-vc100-*-1_50.
Option 2 (build from source first)
As above, download the source files.
Open a Visual Studio Command Prompt with elevated privileges (run as administrator)
Go to C:\Sys\zlib-1.2.7> and type nmake -f win32\Makefile.msc. This will build zlib.
Go to C:\Sys\bzip2-1.0.6> and type nmake -f makefile.msc. This will build gzip2.
The command for boost now becomes b2.exe --with-iostreams -s BZIP2_BINARY=libbz2 -s BZIP2_INCLUDE=C:/Sys/bzip2-1.0.6 -s BZIP2_LIBPATH=C:/Sys/bzip2-1.0.6 -s ZLIB_BINARY=zlib -s ZLIB_INCLUDE=C:/Sys/zlib-1.2.7 -s ZLIB_LIBPATH=C:/Sys/zlib-1.2.7