1.官网说明
How to configure and build the code on Windows
- Unpack and extract the '.tar.gz' file (using an application such as "WinZip").
- If the 'tools' directory on your Windows machine is something other than "c:\Program Files\DevStudio\Vc", change the "TOOLS32 =" line in the file "win32config".
- In a command shell, 'cd' to the "live" directory, and run
genWindowsMakefiles
This will generate - in each subdirectory - a "*.mak" makefile suitable for use by (e.g.) Microsoft Visual Studio.
- Alternatively, if you're starting from a Unix machine, you can generate the Windows Makefiles by running
./genWindowsMakefiles
(after - if necessary - changing the "TOOLS32 =" line in the file "win32config", as noted above). Then, copy the "live" directories and its subdirectories (in ASCII mode) to a Windows machine. - To use these Makefiles from within Visual Studio, use the "Open Workspace" menu command, then (in the file selection dialog) for "Files of type", choose "Makefiles (.mak)". Visual Studio should then prompt you, asking if you want to use this Makefile to set up a new project. Say "OK".
- Note that you will need to build each of the "UsageEnvironment", "groupsock", "liveMedia", and "BasicUsageEnvironment" projects first, before building "testProgs".
- If you wish, you can build the "WindowsAudioInputDevice" project also.
- Doug Kosovic notes: Visual C++ 2003 no longer comes with the old I/O Streams headers iostreams.h et al, or the corresponding library msvcirt.lib. So anybody trying to build the LIVE555 code with VC++ 2003 might find the following useful: A non-sourcecode modification workaround for VC++ 2003 is to copy the missing headers and msvcirt.lib from VC++ 2002. In file 'win32config' add an extra -I switch to COMPILE_OPTS to find the old headers and a -LIBPATH: switch to LINK_OPTS_0 to find msvcirt.lib.
2.修改win32config文件
TOOLS32 = D:\Program Files\Microsoft Visual Studio 9.0\VC
LINK_OPTS_0 = $(linkdebug) msvcirt.lib 中的msvcirt.lib修改为msvcrt.lib
修改groupsock/makefile.head替换"INCLUDES = -Iinclude -I../UsageEnvironment/include" 为"INCLUDES = -Iinclude -I../UsageEnvironment/include -DNO_STRSTREAM,其实就是定义了宏"NO_STRSTREAM"
3.运行genWindowsMakefiles.cmd 在各个了目录下会生成VS能够编译的*.mak文件
4.新建批处理文件compile.bat,内容如下:
call "D:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat"
cd liveMedia
nmake /B -f liveMedia.mak
cd ../groupsock
nmake /B -f groupsock.mak
cd ../UsageEnvironment
nmake /B -f UsageEnvironment.mak
cd ../BasicUsageEnvironment
nmake /B -f BasicUsageEnvironment.mak
cd ../testProgs
nmake /B -f testProgs.mak
cd ../mediaServer
nmake /B -f mediaServer.mak
pause
5. 若要调试应先在win32config加入一行"NODEBUG=1" (或定义宏"DEBUG")。