poco から基本的な ApplicationServer の例を取得しようとしています。私は使っている:
Windows 7 MinGW ポコ Eclipse c++
そのため、一連のハッキングと設定の後、最終的に機能するようになりました。しかし、自分のハッキングが何をしたのかわかりません。自分のハッキングではなく、適切な解決策が必要です。
私が抱えている問題は、ビルド時に「XX への未解決の参照」が大量に発生することです。これらは poco ライブラリからポップアップしています。コードで使用しているものではありません。私のハックは、私の Server.cpp で、参照されている各クラスを調べて、それらを使用することでした。宣言するだけでは不十分で、実際にオブジェクトを使用する必要があります。不平を言っていたものをすべて使用すると、コンパイルされ、期待どおりに実行されます。これは、何が起こっているのかを知っている人にとっては、単純な構成ソリューションを示す動作のように思えます。
私が結論できると思うこと:
- poco ライブラリは適切に構築されています (このハックを導入すると動作します)
- MinGWは正常に動作しています
- 日食のセットアップは、物事を正しくリンクしていない可能性があります。
だから私の質問は次のとおりです。誰かが間違って設定されていることを知っていますか?それがこの動作を引き起こす可能性がありますか? 容認できないほど厄介なハックではなく、これに対する「クリーンな」ソリューションをどのように配置しますか?
問題を回避する私のハッキングされたメイン:
int main(int argc, char** argv)
{
std::cout << "test1" << std::endl;
std::cout.flush();
AgentServer app;
app.run(argc, argv);
LoggingFactory::defaultFactory();
AutoPtr<ConsoleChannel> pCCChannel(new ConsoleChannel);
AutoPtr<FileChannel> pChannel(new FileChannel);
pChannel->setProperty("path", "sample.log");
pChannel->setProperty("rotation", "2 K");
pChannel->setProperty("archive", "timestamp");
Logger::root().setChannel(pChannel);
Logger& logger = Logger::get("TestLogger"); // inherits root channel
poco_warning(logger, "This is a warning");
try
{
Path myPath = new Path();
poco_warning(logger, myPath.current());
int i = NumberParser::parse("5");
FileOutputStream myFileOutputStream("test.file");
myFileOutputStream << "test";
OutputLineEndingConverter conv(myFileOutputStream," ");
std::stringstream xmlstream("test");
UTF8Encoding myUTF8Encoding;
XMLWriter writer(xmlstream,0,"UTF-8", &myUTF8Encoding);
std::ostringstream ostr1("test2");
OutputStreamConverter converter1(ostr1,myUTF8Encoding,myUTF8Encoding);
URI uri;
uri.getHost();
URIStreamOpener opener;
opener.open(uri);
} catch(...)
{
poco_warning(logger, "Swallowing exception");
}
//poco_warning(logger,);
//AgentServer app;
//return app.run(argc, argv);
}