1,下载 MinGW,msys。
2,下载 openal-soft-1.20.1.tar.bz2 : https://www.openal-soft.org/openal-releases/openal-soft-1.20.1.tar.bz2
3,下载cmake : cmake-3.18.0-win64-x64.msi : https://github.com/Kitware/CMake/releases/download/v3.18.0/cmake-3.18.0-win64-x64.msi
安装:
1,安装cmake
2,安装MinGW,msys
3,解压 openal-soft ,进入源码目录,建立 build 目录(如果没有),进入 build 目录,执行 cmake .. -G "MinGW Makefiles",生成Makefile。
4,执行mingw32-make,编译
5,编译出错解决:
Stripping ordinals from OpenAL32.def and generating OpenAL32.lib...
/bin/sed: invalid option -- i
Usage: /bin/sed [OPTION]... {script-only-if-no-other-script} [input-file]...
-n, --quiet, --silent
suppress automatic printing of pattern space
-e script, --expression=script
add the script to the commands to be executed
-f script-file, --file=script-file
add the contents of script-file to the commands to be executed
-c --nocr turn off \r$ translation; must be first switch on command line
--help display this help and exit
-V, --version output version information and exit
If no -e, --expression, -f, or --file option is given, then the first
non-option argument is taken as the sed script to interpret. All
remaining arguments are names of input files; if no input files are
specified, then the standard input is read.
E-mail bug reports to: bug-gnu-utils@gnu.org .
Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.
mingw32-make[2]: *** [CMakeFiles\OpenAL.dir\build.make:924: OpenAL32.dll] Error 4
mingw32-make[2]: *** Deleting file 'OpenAL32.dll'
mingw32-make[1]: *** [CMakeFiles\Makefile2:152: CMakeFiles/OpenAL.dir/all] Error 2
mingw32-make: *** [Makefile:149: all] Error 2
意思是/bin/sed不识别 -i 选项,出错文件是 CMakeFiles\OpenAL.dir\build.make:924 ,编辑该文件,删除 -i 选项
6,继续执行mingw32-make编译,成功。