未定义的引用`的boost ::时辰:: SYSTEM_CLOCK ::现在()“ - 升压和CPP-NETLIB [英] undefined reference to `boost::chrono::system_clock::now()' - Boost, and cpp-netlib

查看:185
本文介绍了未定义的引用`的boost ::时辰:: SYSTEM_CLOCK ::现在()“ - 升压和CPP-NETLIB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来这里问的修复程序已经折腾我的情况。很多。
首先,我在Windows上,我使用的MinGW作为一个编译器(C ++)。结果
结果
我一直有一些问题得到一个程序配合使用CPP-NETLIB和SSL的工作(试图张贴到HTTPS站点)。我相信,一切都是为了除了这个错误一直回避我。
结果
C:\\ boost_1_50_0 \\ boost_1_50_0 \\阶段\\ LIB \\ libboost_thread-mgw46-MT-1_50.a(thread.o):thread.cpp ||未定义引用'的boost ::时辰:: SYSTEM_CLOCK ::现在()搜索结果
我敢肯定,我已经联系到时辰,以及在所有.A库BOOST_ROOT /台/ lib目录。我试着重新排序,以便在计时线程之前联系。没有什么帮助。
我试过definining的 BOOST_CHRONO_INLINED 在我的IDE设置和多种 conf.hpp s到使它只头,这没有帮助。
搜索结果
我是pretty相信这是一个新手的问​​题,我希望有人可以给我速战速决。我在赶时间写了这个,因为我要在某个地方,但如果你需要更多信息请说出来,我可以更仔细地写出来,当我回家。谢谢!


解决方案

  

我试过重新排序,以便在计时线程之前联系。


这是错误的。 Boost.Thread要看时辰,所以计时需要链接的之后的线程,因此链接器知道需要哪些符号,可以找到该库他们和链路来定义它。

I come here to ask for a fix to a situation that has been frustrating me. A lot. First of all, I'm on Windows, I use MinGW as a compiler (C++).

I've been having some problems with getting a program to work with the use of cpp-netlib and SSL (trying to POST to a https site). I believe everything is in order except this one error that keeps evading me.
C:\boost_1_50_0\boost_1_50_0\stage\lib\libboost_thread-mgw46-mt-1_50.a(thread.o):thread.cpp|| undefined reference to 'boost::chrono::system_clock::now()'

I'm sure that I've linked to chrono, as well as all the .a libs in BOOST_ROOT/stage/lib. I've tried re-ordering so chrono is linked before thread. Nothing helped. I've tried definining the BOOST_CHRONO_INLINED in my IDE settings and multiple conf.hpps to make it header only, which didn't help.

I'm pretty sure this is a newbie question and I hope that someone can give me a quick fix. I've written this in a rush because I have to be somewhere but if you need more info please say so and I can write it more carefully when I get home. Thanks!

解决方案

I've tried re-ordering so chrono is linked before thread.

That's wrong. Boost.Thread depends on chrono, so chrono needs to be linked after thread, so the linker knows which symbols are needed and can find which library defines them and link to it.

这篇关于未定义的引用`的boost ::时辰:: SYSTEM_CLOCK ::现在()“ - 升压和CPP-NETLIB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆