如何在Ubuntu上使用Netbeans 6.9配置Boost [英] How to configure Boost with Netbeans 6.9 on Ubuntu

查看:267
本文介绍了如何在Ubuntu上使用Netbeans 6.9配置Boost的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有gcc 4.4.5和最新的boost库。我想使用boost专门为其regex库。我试图使用内置的c + + regex函数,但显然他们还没有完全功能。我按照在线教程设置netbeans。

I have gcc 4.4.5 and the latest boost library. I want to use boost specifically for its regex library. I tried using the built in c++ regex functions but apparently they are not fully functional yet. I followed a tutorial online to set up netbeans.

我添加/ usr / include / boost到c ++代码辅助include目录。然后我将-lboost_regex-mt添加到项目配置中的build> linker>附加选项区域。但我仍然得到这个错误:

I added /usr/include/boost to the c++ code assistance include directories. I then added -lboost_regex-mt to the build>linker>additional options area in the project configuration. but I still get this error:

/usr/bin/ld: cannot find -lboost_regex-mt
collect2: ld returned 1 exit status

这是netbeans创建的命令:

This is the command thats being created by netbeans:

g++ -lboost_regex-mt -o dist/Debug/GNU-Linux-x86/examples01 build/Debug/GNU-Linux-x86/main.o  

我也试过使用-lboost-regex和-lboost-regex-st和同样的错误,只有mt改变。
我也尝试过使用regex对象通过终端运行一个文件,但仍然有同样的错误。任何人都可以帮助这个问题?

I also tried doing it with -lboost-regex and -lboost-regex-st and the same error, with only the mt changed. I also tried running a file using regex objects through the terminal but still got the same error. Can anyone help with this problem? Or at least point me in the right direction?

推荐答案

您必须设置项目的其他库目录,以便它知道

You have to set your project's "Additional Library Directories" so that it knows what other directories to look into for your libraries to link against.

这里是Netbeans网站的截图: http://netbeans.org/community/magazine/html/03/c++/

Here's a screenshot from Netbeans' site here: http://netbeans.org/community/magazine/html/03/c++/

编辑:请注意,这将影响生成的编译器命令具有 -L 选项,它们指定要查找库文件的其他位置。

edit: note that this will affect the generated compiler command to have -L options which specify additional locations to look for library files.

这篇关于如何在Ubuntu上使用Netbeans 6.9配置Boost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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