首页 > 解决方案 > 如何用 cygwin 编译 Poco?

问题描述

我已经从镜像站点下载了 POCO,并且在编译时它无法链接库?例子

#include "Poco/Timestamp.h"
#include<iostream>
#include <ctime>
using Poco::Timestamp;
int main(int argc, char** argv)
{
   Timestamp now; // the current date and time
   std::time_t t1 = now.epochTime(); // convert to time_t ...
   Timestamp ts1(Timestamp::fromEpochTime(t1)); // ... and back again
   for (int i = 0; i < 100000; ++i) ; // wait a bit
   Timestamp::TimeDiff diff = now.elapsed(); // how long did it take?
   Timestamp start(now); // save start time
   now.update(); // update with current
   time
   diff = now - start; // again, how long?
   return 0;
 }

编译错误

$ g++ pocoDemo.cpp
      pocoDemo.cpp:1:10: fatal error: Poco/Timestamp.h: No such file or directory
      compilation terminated.

标签: cygwinpocopoco-libraries

解决方案


推荐阅读