如何用cygwin编译Poco?
我已经从镜像站点下载了POCO,当我编译时,它不能链接库吗? 范例如何用cygwin编译Poco?,cygwin,poco,poco-libraries,Cygwin,Poco,Poco Libraries,我已经从镜像站点下载了POCO,当我编译时,它不能链接库吗? 范例 如何配置包和运行构建?g++需要知道在哪里查找Poco头文件。通常使用-I选项执行此操作。还要记住,这不是“链接库”的问题。这是在编译之后出现的。 #include "Poco/Timestamp.h" #include<iostream> #include <ctime> using Poco::Timestamp; int main(int argc, char** argv) {
如何配置包和运行构建?g++需要知道在哪里查找Poco头文件。通常使用-I选项执行此操作。还要记住,这不是“链接库”的问题。这是在编译之后出现的。
#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.