Search code examples
cmacoscompilationqt4

library not found for -lrt with QtCreator [mac os]


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

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

this is the full build command :

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

and it ends with

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


Solution

  • Why does the program need librt?

    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)

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