本文链接:https://www.jianshu.com/p/6ea100865744

环境

系统:Windows7 SP1 64位

编辑器:Visual Studio Community 2017

Live555:2018-01-24

准备工作

下载源码

http://www.live555.com/liveMedia/public/

下载live555-latest.tar.gz,我的是2018-01-24版本

下载VS

https://www.visualstudio.com/zh-hans/thank-you-downloading-visual-studio/?sku=Community&rel=15

安装VS

安装时选上“使用C+ +的桌面开发”。已经安装过VS但是没有C+ +组件的,在开始-程序和功能中找到Visual Studio Community 2017,选择修改,选上“使用C+ +的桌面开发”。

新建项目

新建live555项目,选择Windows控制台应用程序

把解压出来的live目录下的BasicUsageEnvironment、GroupSock、LiveMedia、UsageEnvironment、MediaServer目录复制到工程目录下

选文件-添加-新建项目,名称是BasicUsageEnvironment

设置项目属性为静态库

设置不使用预编译头

把c和cpp文件添加进源文件目录,h和hh文件添加进头文件目录

用同样的方法新建项目GroupSock、LiveMedia、UsageEnvironment

新建项目MediaServer,添加源文件和头文件

设置附加包含目录

添加include目录

编译运行

按F5开始调试

复制视频文件到Debug目录

打开VLC,按Ctrl+N,输入URL

开始播放

结束。

附上一些报错

生成BasicUsageEnvironment报错:

错误	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

解:把snprintf改成_snprintf_s

参考 http://blog.csdn.net/ztf312/article/details/77183360

另一种方法:可能会出现‘_snprintf’错误,解决此错误的方法是在选择项目->属性->配置属性->C/C++->预处理器->预处理器定义,添加如下信息:_CRT_SECURE_NO_DEPRECATE

编译报错:

错误	C4996	'gethostbyname': Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings	GroupSock	d:\code\vs\live555\groupsock\netaddress.cpp	108

解:

Project properties -> Configuration Properties -> C/C++ -> General -> SDL checks -> No

参考:

https://jingyan.baidu.com/article/1709ad8097e5904634c4f03e.html

编译报错:

错误	C1083	无法打开预编译头文件: “Debug\MediaServer.pch”: No such file or directory	MediaServer	d:\code\vs\live555\mediaserver\stdafx.cpp	5

解:

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/C++ tree and select Precompiled Headers
Precompiled Header: Select Use (/Yu)
Fill in the Precompiled Header File field. Standard is stdafx.h
Click Okay
If you do not have stdafx.h in your Header Files put it there. Edit it to #include all the headers you 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 this time select Precompiled Header Create (/Yc). This will 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 hit Build.

参考 https://stackoverflow.com/questions/6096384/how-to-fix-pch-file-missing-on-build

编译报错:

fatal error C1010: 在查找预编译头时遇到意外的文件结尾

解决方式:

一.
1) 在解决方案资源管理器中,右击相应的.cpp文件,点击“属性”
2) 在左侧配置属性中,点开“C/C++”,单击“预编译头”
3) 更改右侧第一行的“创建/使用预编译头”,把选项从“使用预编译头(/Yu)”改成“不使用预编译头”
4) 注:每一个报错的.cpp都要如此更改哦~辛苦一下呗~
二.
(不推荐)
1)在解决方案右击工程,点击属性
2)在配置属性 -> c/c++ -> 预编译头 中 将 “使用预编译头(/YU)” 改为 “不适用预编译头”
这种做法会使每次编译过程非常缓慢

参考 http://blog.sina.com.cn/s/blog_58649eb30100th2k.html

参考

http://blog.csdn.net/yzhang6_10/article/details/51170151

http://blog.csdn.net/hjl240/article/details/48159243

Windows7上用VS编译本地使用的live555的更多相关文章

  1. makefile实验四 编译本地的源文件 + 变量的高级主题一

    <一>编译本地的源文件 + 变量的模式替换    实验代码 root@ubuntu:~/Makefile_Test/5make_test# vim makefile target := t ...

  2. 在 Windows7 上按照 MySQL5.7

    在 Windows7 上按照 MySQL5.7 1.从官网下载最新版本的 MySQL,这里下载的是 mysql-5.7.17-win32: 2.将下载的 mysql-5.7.17-win32.zip ...

  3. 用java 代码下载Samba服务器上的文件到本地目录以及上传本地文件到Samba服务器

    引入: 在我们昨天架设好了Samba服务器上并且创建了一个 Samba 账户后,我们就迫不及待的想用JAVA去操作Samba服务器了,我们找到了一个框架叫 jcifs,可以高效的完成我们工作. 实践: ...

  4. 如何在其他电脑上运行VS2005编译的DEBUG版应用程序

    做项目的过程中,遇到这样的问题:在自己的电脑上用VS2005编译好的DEBUG版程序在其它的没有安装VS2005的电脑上没有办法运行,郁闷至极啊. 直 接拷贝文件后,错误信息如下:"This ...

  5. 如何在windows7上安装启明星系统。

    启明星系统提供多种安装方式.安装包里自带了setup.exe.每个程序的 install下有在线安装(例如请假应用程序为book,则默认为 http://localhost/book/install ...

  6. ios学习笔记(一)Windows7上使用VMWare搭建iPhone开发环境(转)

    原文地址:http://blog.csdn.net/shangyuan21/article/details/18153605 我们都知道开发iPhone等ios平台的移动应用时需要使用Mac本,但是M ...

  7. memcached在windows7上的安装问题

    memcached在windows7上的安装问题   错误: 通过cmd命令行进入到C:\memcached(下载后的解压目录) 运行 memcached.exe -d install   报错“ f ...

  8. 32位Windows7上8G内存使用感受+xp 32位下使用8G内存 (转)

    32位Windows7上8G内存使用感受+xp 32位下使用8G内存 博客分类: Windows XPWindowsIE企业应用软件测试  我推荐做开发的朋友:赶快加入8G的行列吧....呵呵..超爽 ...

  9. 让32位Eclipse和64位Eclipse同时在64的Windows7上运行

    转自让32位Eclipse和64位Eclipse同时在64的Windows7上运行 参考这篇文章:http://wenku.baidu.com/view/57994c270066f5335a81214 ...

随机推荐

  1. firefox快速刷新error及解决办法

    问题: 测试发过来bug,说——频繁F5刷新页面,会闪现未加载完样式的页面:    开发用的Chrome,没发现这个问题,测试用的firefox,于是从浏览器的刷新加载机制方面搜索解决办法,没搜到,运 ...

  2. Android 一些注意

    半年没碰android,想给一个按钮写个click,硬是想不起来怎么搞,哎! 1.编码问题调整 2.引用框架问题 3.界面设计无法显示问题,需要调整设计界面的API Level 4.任意输入自动提示 ...

  3. Hdu1051 Wooden Sticks 2017-03-11 23:30 62人阅读 评论(0) 收藏

    Wooden Sticks Problem Description There is a pile of n wooden sticks. The length and weight of each ...

  4. FORM 错误:此责任无可用函数。 更改责任或与您的系统管理员联系。

    错误:此责任无可用函数. 更改责任或与您的系统管理员联系. 2014-07-02 12:20:47 分类: Oracle Symptom 访问Help->Diagnostics->Exam ...

  5. Java泛型学习笔记

    泛型是Java5引进的新特征,是类和接口的一种拓展机制,主要实现参数化类型机制.Java的泛型,跟C++的类模板有很多相似的地方,或者说,就是C++类模板的升级版. 泛型类 在开发过程中,我们或许要设 ...

  6. python怎么生成requirements.txt文件

    生成文件: pip freeze > requirements.txt 安装依赖: pip install -r requirements.txt

  7. bootstrap-table简单使用

    开发项目时总想着能不能有一款插件包含分页,查询等常用功能,后来发现了bootstrap-table 直接看代码和效果图 <!DOCTYPE html> <html lang=&quo ...

  8. 纸壳CMS列表Grid的配置

    纸壳CMS(ZKEACMS)里的Grid是一个TagHelper,是对jQuery插件datatables的一个配置封装. Easy.Mvc.TagHelpers.GridTagHelper grid ...

  9. .netcore Swagger 生成 api接口文档

    1, 引用第三方包, Swashbuckle.AspNetCore Swashbuckle.AspNetCore.Swagger Swashbuckle.AspNetCore.SwaggerUI 最简 ...

  10. java invoke(转摘)

      JAVA反射机制是在运行状态中,对于任意一个类,都能够知道这个类的所有属性和方法:对于任意一个对象,都能够调用它的任意一个方法:这种动态获取的以及动态调用对象的方法的功能称为java语言的反射机制 ...