This article link: https://www.jianshu.com/p/6ea100865744
Environment
System: Windows7 SP1 64-bit
Editor: Visual Studio Community 2017
Live555:2018-01-24
Ready to work download source code
http://www.live555.com/liveMedia/public/
Download live555-latest.tar.gz, mine is the 2018-01-24 version
Download vs
Https://www.visualstudio.com/zh-hans/thank-you-downloading-visual-studio/?sku=Community&rel=15
Install vs
Select "Use c+ + Desktop development" at the time of installation. Having installed vs but no c+ + components, find visual Studio Community 2017 in the start-Programs and features, select Modify, and choose "Desktop development using c+ +".
New Project
To create a new live555 project, select the Windows console application
Copy the Basicusageenvironment, Groupsock, Livemedia, Usageenvironment, and MediaServer directories from the extracted live directory to the project directory
Select File-Add-new project, name is Basicusageenvironment
Set project properties to static library
Set not to use precompiled headers
Add c and CPP files to the source file directory, h and HH files to add the header file directory
Create new projects in the same way Groupsock, Livemedia, usageenvironment
New project MediaServer, adding source files and header files
Set additional Include Directories
Add an Include directory
Compile run
Press F5 to start debugging
Copy the video file to the debug directory
Open VLC, press CTRL + N, enter URL
Start playback
End.
Attach some errors
Generate Basicusageenvironment Error:
错误 C4996 ‘_snprintf‘: This function or variable may be unsafe. Consider using _snprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. BasicUsageEnvironment d:\code\vs\live555\basicusageenvironment\basicusageenvironment0.cpp 78
Solution: Change snprintf to _snprintf_s
Reference http://blog.csdn.net/ztf312/article/details/77183360
Another method: the ' _snprintf ' error may occur, and the method to resolve this error is to select the property-----Properties--------preprocessor----preprocessor definition, which is selected, and add the following information: _crt_secure_no_ Deprecate
Compile error:
错误 C4996 ‘gethostbyname‘: Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings GroupSock
Solution:
Project Properties, Configuration Properties, C + +, general, SDL checks
Reference:
Https://jingyan.baidu.com/article/1709ad8097e5904634c4f03e.html
Compile error:
错误 C1083 无法打开预编译头文件: “Debug\MediaServer.pch”: No such file or directory MediaServer d:\code\vs\live555\mediaserver\stdafx.cpp 5
Solution:
Right-click on your project in the solution Explorer.Click Properties at the bottom of the Drop-down menu. At the top left of the ' Properties Pages, select all configurations from the Drop-down menu. Open the C + + tree and select precompiled headersprecompiled header:select use (/yu) Fill in the precompiled Header File Field. Standard is Stdafx.hclick okayif your do not has stdafx.h in your Header Files put it there. Edit it to #include all the headers want precompiled. Put a file named Stdafx.cpp into your project. Put #include "stdafx.h" at the top of it, and nothing else. Right-click on Stdafx.cpp in Solution Explorer. Select Properties and all configurations again as in step 4 ... but the this time select Precompiled Header Create (/yc). This would only bind to the one file Stdafx.cpp.Put #include "stdafx.h" at the very top of all your source files. Lucky 13. Cross your fingers and hits Build.
Reference Https://stackoverflow.com/questions/6096384/how-to-fix-pch-file-missing-on-build
Compile error:
fatal error C1010: 在查找预编译头时遇到意外的文件结尾
How to resolve:
一.1) 在解决方案资源管理器中,右击相应的.cpp文件,点击“属性”2) 在左侧配置属性中,点开“C/C++”,单击“预编译头”3) 更改右侧第一行的“创建/使用预编译头”,把选项从“使用预编译头(/Yu)”改成“不使用预编译头”4) 注:每一个报错的.cpp都要如此更改哦~辛苦一下呗~二.(不推荐)1)在解决方案右击工程,点击属性2)在配置属性 -> c/c++ -> 预编译头 中 将 “使用预编译头(/YU)” 改为 “不适用预编译头”这种做法会使每次编译过程非常缓慢
Reference http://blog.sina.com.cn/s/blog_58649eb30100th2k.html
Reference
http://blog.csdn.net/yzhang6_10/article/details/51170151
http://blog.csdn.net/hjl240/article/details/48159243
Windows7 with vs compile locally used live555