使用 QtCreator [mac os] 找不到 -lrt 的库 [英] library not found for -lrt with QtCreator [mac os]

查看:48
本文介绍了使用 QtCreator [mac os] 找不到 -lrt 的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用选项-lrt"构建的 QT 时遇到了一些问题

i'm getting some troubles with QT it builds with option "-lrt"

我正在使用带有 QT creator 1.2.1 的 mac os 10.6,heeeeeeelp!

i'm using mac os 10.6 with QT creator 1.2.1, heeeeeeelp !

这是完整的构建命令:

g++ -headerpad_max_install_names -oAMiningCoreTest main.o tokenizer.oDictionnaryToolBox.o mysql.o btree.oBTreeDataTable.o tcaccess.o-L/库/框架 -L/usr/lib/mysql -lmysqlclient -L/usr/local/lib/-ltokyocabinet -lz -lbz2 -lrt -lpthread -lm -lc

g++ -headerpad_max_install_names -o AMiningCoreTest main.o tokenizer.o DictionnaryToolBox.o mysql.o btree.o BTreeDataTable.o tcaccess.o -L/Library/Frameworks -L/usr/lib/mysql -lmysqlclient -L/usr/local/lib/ -ltokyocabinet -lz -lbz2 -lrt -lpthread -lm -lc

它以

ld: 找不到 -lrt 的库collect2: ld 返回 1 个退出状态

ld: library not found for -lrt collect2: ld returned 1 exit status

推荐答案

为什么程序需要librt?

Why does the program need librt?

我知道某些平台(想到 Solaris)需要 librt 才能执行某些功能,这些功能可能存在于您操作系统的其他库中.(sem_init()等都是这样的)

I know that some platforms (Solaris comes to mind) require librt for some functions which might exist in other libraries in your OS. (sem_init() et al. are like this)

您可以尝试不使用 -lrt 进行链接,看看是否有效.

You might try to link without -lrt and see if it works.

这篇关于使用 QtCreator [mac os] 找不到 -lrt 的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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