vs2019编译live555

vs2019默认安装位置C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional

首先到网址http://live555.com/liveMedia/public/下载live555-latest.tar.gz并解压缩。

准备工作:

一、修改win32config文件

1. TOOLS32 = C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional

2. LINK = $(link) /out:

3. LINK_OPTS_0 = $(linkdebug) msvcrt.lib

4. C_COMPILER = "$(TOOLS32)\bin\Hostx64\x86\cl"

5. rc32 = "$(TOOLS32)\bin\Hostx64\x86\rc"

二、拷贝ntwin32.mak win32.mak

ntwin32.mak win32.mak在Windows SDK7以后不再保留,安装WIN SDK7 或者从网上下载以获取ntwin32.mak以及win32.mak,拷贝到 C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.23.28105\include

三、生成Makefile文件

到live555-latest\live目录下运行genWindowsMakefiles.cmd

四、编写编译脚本

到live555-latest\live目录下新建WindowsBuild.bat文件,内容如下:

@echo off

call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\Tools\VsDevCmd.bat"


set cur_dir=%cd%

call genWindowsMakefiles.cmd

cd %cur_dir%

set target=liveMedia

echo -----------%target%-----------

cd %cur_dir%\%target%

nmake /B -f %target%.mak

set target=BasicUsageEnvironment

echo -----------%target%-----------

cd %cur_dir%\%target%

nmake /B -f %target%.mak

set target=UsageEnvironment

echo -----------%target%-----------

cd %cur_dir%\%target%

nmake /B -f %target%.mak

set target=groupsock

echo -----------%target%-----------

cd %cur_dir%\%target%

nmake /B -f %target%.mak

REM set target=WindowsAudioInputDevice

REM echo -----------%target%-----------

REM cd %cur_dir%\%target%

REM nmake /B -f %target%.mak

set target=mediaServer

echo -----------%target%-----------

cd %cur_dir%\%target%

nmake /B -f %target%.mak

set target=proxyServer

echo -----------%target%-----------

cd %cur_dir%\%target%

nmake /B -f %target%.mak

set target=testProgs

echo -----------%target%-----------

cd %cur_dir%\%target%

nmake /B -f %target%.mak

:End

echo -----------------------build exe and lib-----------------------

cd %cur_dir%

for /r "%cur_dir%" %%i in (*.lib) do echo %%i

for /r "%cur_dir%" %%i in (*.exe) do echo %%i

echo -----------------------Then End-----------------------

rem pause


五、开启最终编译

进入live555-latest\live目录,运行命令.\WindowsBuild.bat 或者直接鼠标双击。

你可能感兴趣的:(vs2019编译live555)