• Diese Seite verwendet Cookies. Indem du diese Website weiterhin nutzt, erklärst du dich mit der Verwendung von Cookies einverstanden. Erfahre mehr

Qt-Programme kompilieren:

beelzebub

CUPS-Geplagter
Themenstarter #1
bash-2.05b$ export QTDIR=/usr/X11R6
bash-2.05b$ gmake
/usr/X11R6/bin/moc programm.cpp > programm.moc
g++ -I/usr/X11R6/include -L/usr/X11R6/lib -lqt -o programm programm.cpp
/usr/libexec/elf/ld: cannot find -lqt
gmake: *** [programm] Error 1
bash-2.05b$

Was würde da helfen?
 
#2
Ich habe kein qt installiert, aber der Tipp wäre, dass

1. libqt.so nicht unter /usr/X11R6/lib liegt
2. nicht libqt.so heisst, sondern libqtN.so heisst, wobei N=eine Zahl

Was ist der Fall?
 

beelzebub

CUPS-Geplagter
Themenstarter #3
-lqt-mt, ja, aber, das bringt wieder errors:
bash-2.05b$ make
/usr/X11R6/bin/moc programm.cpp > programm.moc
g++ -I/usr/X11R6/include -L/usr/X11R6/lib -lqt-mt -o programm programm.cpp
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_cleanup_pop'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_attr_destroy'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_create'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_attr_init'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_exit'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_cancel'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_mutexattr_destroy'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_testcancel'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_cleanup_push'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_attr_getschedpolicy'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_once'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_attr_setinheritsched'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_mutexattr_settype'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_mutexattr_init'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_mutex_trylock'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_attr_setschedpolicy'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_attr_setschedparam'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_attr_setdetachstate'
/usr/X11R6/lib/libqt-mt.so: undefined reference to `pthread_cond_timedwait'
*** Error code 1

Stop in /usr/home/cml/füllb_slider.
 

beelzebub

CUPS-Geplagter
Themenstarter #5
Stimmt es läuft, der vollständigkeit halber will ich aber nochmal ein paar Warnings listen, die trotzdem nicht verschwunden sind!

(Haben allerdings keinen Einfluss auf Funktion des Programms, bis jetzt)

bash-2.05b$ export QTDIR=/usr/X11R6
bash-2.05b$ make
/usr/X11R6/bin/moc programm.cpp > programm.moc
g++ -I/usr/X11R6/include -L/usr/X11R6/lib -lqt-mt -lc_r -lXext -o programm programm.cpp
/usr/lib/libc.so: WARNING! setkey(3) not present in the system!
/usr/lib/libc.so: warning: this program uses gets(), which is unsafe.
/usr/lib/libc.so: warning: mktemp() possibly used unsafely; consider using mkstemp()
/usr/lib/libc.so: WARNING! des_setkey(3) not present in the system!
/usr/lib/libc.so: WARNING! encrypt(3) not present in the system!
/usr/lib/libc.so: warning: tmpnam() possibly used unsafely; consider using mkstemp()
/usr/lib/libc.so: warning: this program uses f_prealloc(), which is not recommended.
/usr/lib/libc.so: WARNING! des_cipher(3) not present in the system!
/usr/lib/libc.so: warning: tempnam() possibly used unsafely; consider using mkstemp()
bash-2.05b$ ./programm
 

r0b0

Well-Known Member
#6
Ok, ein bisschen spät aber ich hatte gerade das selbe Problem.

Code:
%> gcc -I/usr/X11R6/include -L/usr/X11R6/lib -lc_r -lqt-mt test.cpp
/usr/lib/libc.so: WARNING!  setkey(3) not present in the system!
/usr/lib/libc.so: warning: this program uses gets(), which is unsafe.
/usr/lib/libc.so: warning: mktemp() possibly used unsafely; consider using mkstemp()
/usr/lib/libc.so: WARNING!  des_setkey(3) not present in the system!
/usr/lib/libc.so: WARNING!  encrypt(3) not present in the system!
/usr/lib/libc.so: warning: tmpnam() possibly used unsafely; consider using mkstemp()
/usr/lib/libc.so: warning: this program uses f_prealloc(), which is not recommended.
/usr/lib/libc.so: WARNING!  des_cipher(3) not present in the system!
/usr/lib/libc.so: warning: tempnam() possibly used unsafely; consider using mkstemp()
Nimmt man aber -pthread statts -lc_r sieht das viel freundlicher aus.

Code:
%> gcc -I/usr/X11R6/include -L/usr/X11R6/lib -pthread -lqt-mt test.cpp
Gruß, r0b0