我的VS2008安装在:d:\Program Files\Microsoft Visual Studio 9.0
poco解压后目录:D:\poco-1.4.6p2
1、下载poco库:http://pocoproject.org/documentation/index.html
2、编译库文件。开始菜单–Microsoft Visual Studio 2008–Visual Studio Tools—Open Visual Studio 2008 Command Prompt 打开命令行窗口。
3、编译。cd命令进入poco根目录,D:\poco-1.4.6p2。输入命令:buildwin 90 回车。
解释:90 visual studio的版本,可以是71, 80 或 90
4、编译完成后
把D:\poco-1.4.6p2\Foundation\include下poco目录拷贝到d:\Program Files\Microsoft Visual Studio 9.0\VC\include。
把D:\poco-1.4.6p2\lib下所有文件拷贝到d:\Program Files\Microsoft Visual Studio 9.0\VC\lib。
把D:\poco-1.4.6p2\bin下所有文件拷贝到:d:\Program Files\Microsoft Visual Studio 9.0\VC\bin
#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;
}