G ++找不到Boost库。我说,他们在众目睽睽 [英] G++ can't find boost libraries. I say they're in plain sight

查看:201
本文介绍了G ++找不到Boost库。我说,他们在众目睽睽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图建立一些code。下面是我得到的错误:

I'm trying to build some code. Here is the error I'm getting:

main.o: In function `__static_initialization_and_destruction_0':
/home/jmbeck/Downloads/boost_1_48_0/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'

还有更多,但我不认为这是相关的。

There is more, but I don't think it's relevant.

下面是构建命令:

g++ -I/home/jmbeck/Downloads/boost_1_48_0 
    -L/home/jmbeck/Downloads/boost_1_48_0/stage/lib 
    -lm 
    -lboost_system 
    -lboost_thread
    -lboost_regex 
    main.cpp

到/ home / jmbeck /下载/ boost_1_48_0 /舞台/ lib目录中包含预期的文件:

The /home/jmbeck/Downloads/boost_1_48_0/stage/lib directory contains the expected files:

libboost_system.a
libboost_system.so@
libboost_system.so.1.48.0*
libboost_thread.a
libboost_thread.so@
libboost_thread.so.1.48.0* 
libboost_regex.a
libboost_regex.so@
libboost_regex.so.1.48.0*
... etc...

我试图建立一个快速的程序,没有使用pre-编译库,它编译就好了。它找到合适的标题,而不是库。

I've tried building a quick program that didn't use the pre-compiled libraries, and it compiled just fine. It finds the appropriate headers, but not the libraries.

我在做什么错了?

推荐答案

尝试把库中的之后的main.cpp

我已经经历了过去的一些怪事,当GCC忽略库,因为它不认为他们已经习惯,达到我的源文件了。

I've experienced some weirdness in the past when GCC ignores libraries because it doesn't think they're used, before reaching my source files.

这篇关于G ++找不到Boost库。我说,他们在众目睽睽的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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