POCO C++ 1.4.2 Win7 VS2010安装配置
2014-03-03 17:27
555 查看
最近进行OGRE应用程序的开发,需要用到网络组件。经过对比,选择使用POCO C++作为网络开发库。使用POCO首先需知道如何安装POCO库,下面我将就我的经验为大家作一个完整安装说明。
系统环境:Windows 7 Ultimate
集成开发环境:VS 2010
POCO版本:1.4.2
安装步骤:
1. 下载源码包。在POCO的官方网站下载最新的POCO源码包。http://pocoproject.org/download/index.html
2.解压源码包。下载的文件名是“poco-1.4.2.zip”,将其解压在F:\POCO目录下。
3.编译库文件。开始菜单–Microsoft Visual Studio 2010–Visual Studio Tools—Open Visual Studio 2010 Command Prompt 打开命令行窗口。cd命令进入poco根目录,F:\POCO\poco-1.4.2。输入命令:buildwin 100 回车。
4.等待编译完成,花费了一个多小时。
5.设置环境变量。POCO_HOME F:\POCO\poco-1.4.2
6.添加Include目录。打开工程属性页,在“Configuration Properties -> C/C++ -> General -> Additional Include Directories”栏目中添加“$(POCO_HOME)\Foundation\include”,确认并应用该设置。
7.添加lib链接库。打开属性页,在“Configuration Properties -> Linker -> General -> Additional Library Directories”栏目中添加lib目录路径$(POCO_HOME)\lib。在“Configuration Properties -> Linker -> Input -> Additional Dependencies”中添加应用程序需要用到的lib文件。
8.更改输出路径,以便项目生成的应用程序能够调用DLL文件。打开工程属性,将“Configuration Properties -> General -> Output Directory”改为“$(POCO_HOME)\bin”;将“Configuration Properties -> Debugging -> Working Directory”改为“$(OutDir)”。
9.设置完成后,重启Visual Studio。
示例代码,用于检测安装环境是否正确。
#include "stdafx.h"
#include "Poco/DateTime.h"
#include "Poco/DateTimeFormat.h"
#include
using Poco::DateTime;
using Poco::DateTimeFormat;
int main(int argc, char** argv)
{
DateTime now;
std::cout << "Today is "
<< DateTimeFormat::WEEKDAY_NAMES[now.dayOfWeek()] << ", "
<< DateTimeFormat::MONTH_NAMES[now.month() - 1] << " "
<< now.day() << " - "
<< "day number "
<< now.dayOfYear()
<< " in "
<< now.year()
<< " and day number "
<< (long) now.julianDay()
<< " in the Julian calendar." << std::endl;
return 0;
}
系统环境:Windows 7 Ultimate
集成开发环境:VS 2010
POCO版本:1.4.2
安装步骤:
1. 下载源码包。在POCO的官方网站下载最新的POCO源码包。http://pocoproject.org/download/index.html
2.解压源码包。下载的文件名是“poco-1.4.2.zip”,将其解压在F:\POCO目录下。
3.编译库文件。开始菜单–Microsoft Visual Studio 2010–Visual Studio Tools—Open Visual Studio 2010 Command Prompt 打开命令行窗口。cd命令进入poco根目录,F:\POCO\poco-1.4.2。输入命令:buildwin 100 回车。
4.等待编译完成,花费了一个多小时。
5.设置环境变量。POCO_HOME F:\POCO\poco-1.4.2
6.添加Include目录。打开工程属性页,在“Configuration Properties -> C/C++ -> General -> Additional Include Directories”栏目中添加“$(POCO_HOME)\Foundation\include”,确认并应用该设置。
7.添加lib链接库。打开属性页,在“Configuration Properties -> Linker -> General -> Additional Library Directories”栏目中添加lib目录路径$(POCO_HOME)\lib。在“Configuration Properties -> Linker -> Input -> Additional Dependencies”中添加应用程序需要用到的lib文件。
8.更改输出路径,以便项目生成的应用程序能够调用DLL文件。打开工程属性,将“Configuration Properties -> General -> Output Directory”改为“$(POCO_HOME)\bin”;将“Configuration Properties -> Debugging -> Working Directory”改为“$(OutDir)”。
9.设置完成后,重启Visual Studio。
示例代码,用于检测安装环境是否正确。
#include "stdafx.h"
#include "Poco/DateTime.h"
#include "Poco/DateTimeFormat.h"
#include
using Poco::DateTime;
using Poco::DateTimeFormat;
int main(int argc, char** argv)
{
DateTime now;
std::cout << "Today is "
<< DateTimeFormat::WEEKDAY_NAMES[now.dayOfWeek()] << ", "
<< DateTimeFormat::MONTH_NAMES[now.month() - 1] << " "
<< now.day() << " - "
<< "day number "
<< now.dayOfYear()
<< " in "
<< now.year()
<< " and day number "
<< (long) now.julianDay()
<< " in the Julian calendar." << std::endl;
return 0;
}
相关文章推荐
- 怎样构造一个正确高效的C++的类的拷贝构造函数和赋值函数
- 简单程序结构体实例的展现(C++语言)
- java向C++发送字符串数据
- C++处理URL的方法,项目有用到,过程记录如下
- 标准C++中的string类的用法总结
- 怎样构造一个正确高效的C++的类的构造函数
- C语言学习之基础学习01
- c++ 创建 socket server
- C++静态成员变量的初始化
- 【C语言】11-指针
- C语言经典算法100例-019-求完数
- C/C++中const关键字详解
- 设计模式C++实现(2)——策略模式
- C++实现文件关联
- 关于fflush(stdin)清空输入缓存流(C/C++) 新手必看!!
- C++中将string类型转换为int, float, double类型
- GCC下,C语言参数的内存分配 以及 函数可变参数
- 重启资源管理器导致托盘图标消失的解决方法
- C++中如何在一个构造函数中调用另一个构造函数
- C++高性能服务框架revolver:同时支持100万个的定时事件的定时器