vs2010 没法打开包括文件:“streams.h”: No such file or directory

You need DirectShow SDK that is now a part of Platform SDK
(Windows Server 2003 SP1 SDK or later),
and DirectX SDK (2006 April or later).

1. Download the Platform SDK from
   http://www.microsoft.com/msdownload/platformsdk/sdkupdate/

SDK 7.1 ISO离线安装包下载地址:

Microsoft Windows SDK for Windows 7 and .NET Framework 4 (ISO)

Get the ISO Download of the Windows SDK for Windows Server 2008

   and DirectX SDK from msdn.microsoft.com/directx/
   (They are huge, but you can download it by parts).
   If it doesn't work for you, consider HighGUI that can capture video via VFW or MIL

2. Install Platform SDK together with DirectShow SDK.
   Install DirectX (with or without sample code).

3. Build baseclasses.
   See <PlatformSDKInstallFolder>\samples\multimedia\directshow\readme.txt.

4. Copy the built libraries (called strmbase.lib and strmbasd.lib
   in Release and Debug versions, respectively) to
   <PlatformSDKInstallFolder>\lib.

5. In Developer Studio add the following paths:
      <DirectXSDKInstallFolder>\include
      <PlatformSDKInstallFolder>\include
      <PlatformSDKInstallFolder>\samples\multimedia\directshow\baseclasses
    to the includes' search path
    (at Tools->Options->Directories->Include files in case of Visual Studio 6.0,
     at Tools->Options->Projects and Solutions->VC++ Directories->Include files in case
     of Visual Studio 2005)
   Add
      <DirectXSDKInstallFolder>\lib
      <PlatformSDKInstallFolder>\lib
   to the libraries' search path (in the same dialog, ...->"Library files" page)

   NOTE: PUT THE ADDED LINES ON THE VERY TOP OF THE LISTS, OTHERWISE YOU MAY STILL GET
   COMPILER OR LINKER ERRORS. This is necessary, because Visual Studio
   may include older versions of the same headers and libraries.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
这是一个TCP客户端的源代码,可以用来连接TCP服务器并发送和接收数据。 这个程序包含了以下头文件: ```c++ #include <iostream> #include <string> #include <cstring> #include <netinet/in.h> #include <arpa/inet.h> #include <unistd.h> #include <strings.h> ``` 其中, `iostream` 和 `string` 用于输入输出和字符串操作, `netinet/in.h` 和 `arpa/inet.h` 用于网络编程中的地址转换, `unistd.h` 用于标准I/O操作, `strings.h` 用于字符串操作。 函数 `Usage` 用于输出程序的用法,函数 `main` 中通过命令行参数获取服务器的IP地址和端口号,并进行错误检查。 接下来,程序创建了一个套接字,使用 `socket` 函数: ```c++ // 1.创建套接字,打开网络文件 int sock = socket(AF_INET, SOCK_STREAM, 0); ``` `AF_INET` 表示使用IPv4协议, `SOCK_STREAM` 表示使用TCP协议。 接着,程序使用 `connect` 函数连接服务器: ```c++ // 2.向服务器发起连接请求 struct sockaddr_in server; bzero(&server, sizeof(server)); server.sin_family = AF_INET; server.sin_port = htons(svr_port); server.sin_addr.s_addr = inet_addr(svr_ip.c_str()); if(connect(sock, (struct sockaddr*)&server, sizeof(server)) < 0) { std::cerr << "connect error!" << std::endl; close(sock); return 3; } ``` 这里使用了 `struct sockaddr_in` 结构体来表示服务器的地址, `bzero` 函数用于将地址结构体清零, `htons` 函数用于将端口号从主机字节序转换为网络字节序, `inet_addr` 函数用于将IP地址转换为网络字节序。 如果连接成功,程序就可以使用 `send` 函数向服务器发送数据,使用 `recv` 函数接收服务器发来的数据。 最后,程序使用 `close` 函数关闭套接字。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值