Add library linker command line

The place to discuss linux version of MakeMKV
Post Reply
jvillain
Posts: 2
Joined: Tue Mar 09, 2010 12:17 am

Add library linker command line

Post 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
sstlr
Posts: 2
Joined: Tue Mar 09, 2010 8:42 am

Re: Add library linker command line

Post 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).
jvillain
Posts: 2
Joined: Tue Mar 09, 2010 12:17 am

Re: Add library linker command line

Post 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
mike admin
Posts: 4075
Joined: Wed Nov 26, 2008 2:26 am
Contact:

Re: Add library linker command line

Post by mike admin »

Can you please check what happens if you add "-lpthread -lrt" before "-lQtGui -lQtCore", right after "-lc -lstdc++"?
JackieBrown
Posts: 3
Joined: Thu Feb 04, 2010 2:39 am

Re: Add library linker command line

Post by JackieBrown »

I get this error when compiling in debian. Where are you putting that line?

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