[gelöst] undefined reference to
Verfasst: 5. November 2012 13:39
Hallo,
da ich in meinem Project nur einen sehr kleinen Teil von libqxt benötige, habe ich mir die Quellen von http://dev.libqxt.org/libqxt/wiki/Home geholt, und die
-qxtglobalshortcut_x11.cpp
-qxtglobalshortcut_p.h
-qxtglobalshortcut.h
-qxtglobal.h
-qxtglobal.cpp
in das Project integriert.
Beim compilieren werden die Object Dateien erststellt, aber beim linken wirft der g++ fogendes
g++ -m64 -Wl,-O1 -o vokoscreen main.o screencast.o regionselection.o QvkLupe.o QvkWebcam.o qtsingleapplication.o qtlocalpeer.o qxtglobal.o qxtwindowsystem_x11.o qxtglobalshortcut_x11.o moc_screencast.o moc_regionselection.o moc_QvkLupe.o moc_QvkWebcam.o moc_qtsingleapplication.o moc_qtlocalpeer.o moc_qxtglobalshortcut.o qrc_screencast.o -L/usr/lib64 -lX11 -lQtTest -L/usr/lib64 -lQtGui -L/usr/X11R6/lib64 -lQtNetwork -lQtCore -lpthread
screencast.o: In function `screencast::screencast()':
screencast.cpp:(.text+0xc1d9): undefined reference to `QxtGlobalShortcut::QxtGlobalShortcut(QObject*)'
screencast.cpp:(.text+0xc22d): undefined reference to `QxtGlobalShortcut::setShortcut(QKeySequence const&)'
screencast.cpp:(.text+0xc268): undefined reference to `QxtGlobalShortcut::QxtGlobalShortcut(QObject*)'
screencast.cpp:(.text+0xc2bc): undefined reference to `QxtGlobalShortcut::setShortcut(QKeySequence const&)'
qxtglobalshortcut_x11.o: In function `qxt_x_errhandler(_XDisplay*, XErrorEvent*)':
qxtglobalshortcut_x11.cpp:(.text+0x32): undefined reference to `QxtGlobalShortcutPrivate::error'
qxtglobalshortcut_x11.o: In function `QxtGlobalShortcutPrivate::eventFilter(void*)':
qxtglobalshortcut_x11.cpp:(.text+0x5e): undefined reference to `QxtGlobalShortcutPrivate::activateShortcut(unsigned int, unsigned int)'
qxtglobalshortcut_x11.o: In function `QxtGlobalShortcutPrivate::registerShortcut(unsigned int, unsigned int)':
qxtglobalshortcut_x11.cpp:(.text+0x229): undefined reference to `QxtGlobalShortcutPrivate::error'
qxtglobalshortcut_x11.cpp:(.text+0x29c): undefined reference to `QxtGlobalShortcutPrivate::error'
qxtglobalshortcut_x11.o: In function `QxtGlobalShortcutPrivate::unregisterShortcut(unsigned int, unsigned int)':
qxtglobalshortcut_x11.cpp:(.text+0x2f9): undefined reference to `QxtGlobalShortcutPrivate::error'
qxtglobalshortcut_x11.cpp:(.text+0x346): undefined reference to `QxtGlobalShortcutPrivate::error'
moc_qxtglobalshortcut.o: In function `QxtGlobalShortcut::qt_metacall(QMetaObject::Call, int, void**)':
moc_qxtglobalshortcut.cpp:(.text+0x194): undefined reference to `QxtGlobalShortcut::shortcut() const'
moc_qxtglobalshortcut.cpp:(.text+0x1dc): undefined reference to `QxtGlobalShortcut::isEnabled() const'
moc_qxtglobalshortcut.cpp:(.text+0x1f9): undefined reference to `QxtGlobalShortcut::setShortcut(QKeySequence const&)'
moc_qxtglobalshortcut.cpp:(.text+0x207): undefined reference to `QxtGlobalShortcut::setEnabled(bool)'
moc_qxtglobalshortcut.o: In function `QxtGlobalShortcut::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)':
moc_qxtglobalshortcut.cpp:(.text+0xa8): undefined reference to `QxtGlobalShortcut::setDisabled(bool)'
moc_qxtglobalshortcut.cpp:(.text+0xb6): undefined reference to `QxtGlobalShortcut::setEnabled(bool)'
moc_qxtglobalshortcut.cpp:(.text+0xc8): undefined reference to `QxtGlobalShortcut::setEnabled(bool)'
moc_qxtglobalshortcut.cpp:(.text+0xde): undefined reference to `QxtGlobalShortcut::setDisabled(bool)'
moc_qxtglobalshortcut.o:(.rodata._ZTV17QxtGlobalShortcut[_ZTV17QxtGlobalShortcut]+0x28): undefined reference to `QxtGlobalShortcut::~QxtGlobalShortcut()'
moc_qxtglobalshortcut.o:(.rodata._ZTV17QxtGlobalShortcut[_ZTV17QxtGlobalShortcut]+0x30): undefined reference to `QxtGlobalShortcut::~QxtGlobalShortcut()'
Normalerweise würde ich jetzt sagen er findet die Lib nicht, aber ich habe doch den Quellcode eingbaut. Was mach ich falsch bzw. wo muß ich ansetzten?
Viele grüße Volker
da ich in meinem Project nur einen sehr kleinen Teil von libqxt benötige, habe ich mir die Quellen von http://dev.libqxt.org/libqxt/wiki/Home geholt, und die
-qxtglobalshortcut_x11.cpp
-qxtglobalshortcut_p.h
-qxtglobalshortcut.h
-qxtglobal.h
-qxtglobal.cpp
in das Project integriert.
Beim compilieren werden die Object Dateien erststellt, aber beim linken wirft der g++ fogendes
g++ -m64 -Wl,-O1 -o vokoscreen main.o screencast.o regionselection.o QvkLupe.o QvkWebcam.o qtsingleapplication.o qtlocalpeer.o qxtglobal.o qxtwindowsystem_x11.o qxtglobalshortcut_x11.o moc_screencast.o moc_regionselection.o moc_QvkLupe.o moc_QvkWebcam.o moc_qtsingleapplication.o moc_qtlocalpeer.o moc_qxtglobalshortcut.o qrc_screencast.o -L/usr/lib64 -lX11 -lQtTest -L/usr/lib64 -lQtGui -L/usr/X11R6/lib64 -lQtNetwork -lQtCore -lpthread
screencast.o: In function `screencast::screencast()':
screencast.cpp:(.text+0xc1d9): undefined reference to `QxtGlobalShortcut::QxtGlobalShortcut(QObject*)'
screencast.cpp:(.text+0xc22d): undefined reference to `QxtGlobalShortcut::setShortcut(QKeySequence const&)'
screencast.cpp:(.text+0xc268): undefined reference to `QxtGlobalShortcut::QxtGlobalShortcut(QObject*)'
screencast.cpp:(.text+0xc2bc): undefined reference to `QxtGlobalShortcut::setShortcut(QKeySequence const&)'
qxtglobalshortcut_x11.o: In function `qxt_x_errhandler(_XDisplay*, XErrorEvent*)':
qxtglobalshortcut_x11.cpp:(.text+0x32): undefined reference to `QxtGlobalShortcutPrivate::error'
qxtglobalshortcut_x11.o: In function `QxtGlobalShortcutPrivate::eventFilter(void*)':
qxtglobalshortcut_x11.cpp:(.text+0x5e): undefined reference to `QxtGlobalShortcutPrivate::activateShortcut(unsigned int, unsigned int)'
qxtglobalshortcut_x11.o: In function `QxtGlobalShortcutPrivate::registerShortcut(unsigned int, unsigned int)':
qxtglobalshortcut_x11.cpp:(.text+0x229): undefined reference to `QxtGlobalShortcutPrivate::error'
qxtglobalshortcut_x11.cpp:(.text+0x29c): undefined reference to `QxtGlobalShortcutPrivate::error'
qxtglobalshortcut_x11.o: In function `QxtGlobalShortcutPrivate::unregisterShortcut(unsigned int, unsigned int)':
qxtglobalshortcut_x11.cpp:(.text+0x2f9): undefined reference to `QxtGlobalShortcutPrivate::error'
qxtglobalshortcut_x11.cpp:(.text+0x346): undefined reference to `QxtGlobalShortcutPrivate::error'
moc_qxtglobalshortcut.o: In function `QxtGlobalShortcut::qt_metacall(QMetaObject::Call, int, void**)':
moc_qxtglobalshortcut.cpp:(.text+0x194): undefined reference to `QxtGlobalShortcut::shortcut() const'
moc_qxtglobalshortcut.cpp:(.text+0x1dc): undefined reference to `QxtGlobalShortcut::isEnabled() const'
moc_qxtglobalshortcut.cpp:(.text+0x1f9): undefined reference to `QxtGlobalShortcut::setShortcut(QKeySequence const&)'
moc_qxtglobalshortcut.cpp:(.text+0x207): undefined reference to `QxtGlobalShortcut::setEnabled(bool)'
moc_qxtglobalshortcut.o: In function `QxtGlobalShortcut::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)':
moc_qxtglobalshortcut.cpp:(.text+0xa8): undefined reference to `QxtGlobalShortcut::setDisabled(bool)'
moc_qxtglobalshortcut.cpp:(.text+0xb6): undefined reference to `QxtGlobalShortcut::setEnabled(bool)'
moc_qxtglobalshortcut.cpp:(.text+0xc8): undefined reference to `QxtGlobalShortcut::setEnabled(bool)'
moc_qxtglobalshortcut.cpp:(.text+0xde): undefined reference to `QxtGlobalShortcut::setDisabled(bool)'
moc_qxtglobalshortcut.o:(.rodata._ZTV17QxtGlobalShortcut[_ZTV17QxtGlobalShortcut]+0x28): undefined reference to `QxtGlobalShortcut::~QxtGlobalShortcut()'
moc_qxtglobalshortcut.o:(.rodata._ZTV17QxtGlobalShortcut[_ZTV17QxtGlobalShortcut]+0x30): undefined reference to `QxtGlobalShortcut::~QxtGlobalShortcut()'
Normalerweise würde ich jetzt sagen er findet die Lib nicht, aber ich habe doch den Quellcode eingbaut. Was mach ich falsch bzw. wo muß ich ansetzten?
Viele grüße Volker