Page 1 of 1

Add library linker command line

Posted: Tue Mar 09, 2010 12:31 am
by jvillain
I get the following and the money line would appear to be

/usr/bin/ld: /tmp/ccOBy7h6.o: undefined reference to symbol 'sem_timedwait@@GLIBC_2.2.5'
/usr/bin/ld: note: 'sem_timedwait@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line

How do I add /lib64/libpthread.so.0 to the linker line?

I am running Fedora 13. I had successfully built a previous version on Fedora 12.

Thanks

Code: Select all

mkdir -p out
gcc -O3 -D_linux_ -oout/makemkv.full -Imakemkvgui/inc -Ilibmakemkv/inc -Isstring/inc -Ilibdriveio/inc \
        makemkvgui/src/aboutbox.cpp makemkvgui/src/client.cpp makemkvgui/src/dirselectbox.cpp makemkvgui/src/logic.cpp makemkvgui/src/logtext.cpp makemkvgui/src/main.cpp makemkvgui/src/nativefiledialog.cpp makemkvgui/src/mainwnd.cpp makemkvgui/src/marshall.cpp makemkvgui/src/progress.cpp makemkvgui/src/scsiinfo.cpp makemkvgui/src/settingdlg.cpp makemkvgui/src/uisync.cpp makemkvgui/src/viteminfo.cpp makemkvgui/src/backupdlg.cpp makemkvgui/src/str/getstr.cpp makemkvgui/src/str/en_utf16.cpp makemkvgui/src/api_posix.cpp makemkvgui/src/api_linux.cpp makemkvgui/src/logic_posix.cpp tmp/qt_rsrc.cpp tmp/moc_mainwnd.cpp tmp/moc_logtext.cpp tmp/moc_dirselectbox.cpp tmp/moc_aboutbox.cpp tmp/moc_settingdlg.cpp tmp/moc_backupdlg.cpp sstring/src/sstring.cpp libdriveio/src/srlist.cpp \
        -DHAVE_BUILDINFO_H -Itmp \
        -I/usr/include/qt4 -I/usr/lib/qt4/include -L/usr/lib/qt4 -L/usr/lib/qt4/lib -lc -lstdc++ -lQtGui -lQtCore
/usr/bin/ld: /tmp/ccOBy7h6.o: undefined reference to symbol 'sem_timedwait@@GLIBC_2.2.5'
/usr/bin/ld: note: 'sem_timedwait@@GLIBC_2.2.5' is defined in DSO /lib64/libpthread.so.0 so try adding it to the linker command line
/lib64/libpthread.so.0: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [out/makemkv.full] Error 1

Re: Add library linker command line

Posted: Tue Mar 09, 2010 9:32 am
by sstlr
Try to add "-lpthread" to CFLAGS or CXXFLAGS or LDFLAGS in Makefile, whichever is used for the final gcc linking command (I don't have the Makefile here right now to check myself).

Re: Add library linker command line

Posted: Tue Mar 09, 2010 5:26 pm
by jvillain
Thanks for your help. Adding -lpthread moved the goal post and -lrt got it to build clean. The full line is below for when the Fedora guys upgrade to 13 and start running into this.

-I/usr/include/qt4 -I/usr/lib/qt4/include -L/usr/lib/qt4 -L/usr/lib/qt4/lib -lc -lstdc++ -lQtGui -lQtCore -lpthread -lrt

Re: Add library linker command line

Posted: Wed Mar 10, 2010 9:50 am
by mike admin
Can you please check what happens if you add "-lpthread -lrt" before "-lQtGui -lQtCore", right after "-lc -lstdc++"?

Re: Add library linker command line

Posted: Sun Mar 21, 2010 2:03 pm
by JackieBrown
I get this error when compiling in debian. Where are you putting that line?

edit ** nevermind. jvillain's adjustment fixed it.