Opened 23 months ago
Closed 23 months ago
#318 closed defect (fixed)
Build error - undefined reference to symbol
| Reported by: | gbell12 | Owned by: | laurent |
|---|---|---|---|
| Priority: | blocker | Milestone: | QuteCom 3.0 |
| Component: | Build System | Version: | 2.2 |
| Keywords: | build fail undefined reference | Cc: |
Description
Under FC14:
Linking CXX executable owcrashreport
/usr/bin/ld: CMakeFiles/owcrashreport.dir/moc_QtCrashReport.o: undefined reference to symbol 'QObject::childEvent(QChildEvent*)'
/usr/bin/ld: note: 'QObject::childEvent(QChildEvent*)' is defined in DSO /usr/lib/libQtCore.so.4 so try adding it to the linker command line
/usr/lib/libQtCore.so.4: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: * [crashreport/owcrashreport] Error 1
make[1]: * [crashreport/CMakeFiles/owcrashreport.dir/all] Error 2
make: * [all] Error 2
Happy to provide whatever log files, cmake output, etc.
Attachments (2)
Change History (21)
comment:1 Changed 23 months ago by laurent
comment:2 Changed 23 months ago by gbell12
I did but I'm on FC14. Didn't think it was the same problem...
Changed 23 months ago by laurent
comment:3 Changed 23 months ago by laurent
Could you test with this patch ?
comment:4 Changed 23 months ago by laurent
if it doesn't work, could you post the faulty linker command ?
comment:5 follow-up: ↓ 6 Changed 23 months ago by gbell12
For some reason I couldn't get that patch to apply (-p0, -p1, -p2). Whatever. Added qt4 to a clean untar'ed 2.2.1 and same error.
Happy to post the faulty linker command. Where do I find that?
comment:6 in reply to: ↑ 5 Changed 23 months ago by laurent
Replying to gbell12:
For some reason I couldn't get that patch to apply (-p0, -p1, -p2). Whatever. Added qt4 to a clean untar'ed 2.2.1 and same error.
Sorry it was made against 3.0 trunk
Happy to post the faulty linker command. Where do I find that?
make VERBOSE=1 should print full command
comment:7 Changed 23 months ago by gbell12
make[2]: Entering directory `/data/home/margaret/Downloads/skype_alts/qutecom-2.
2.1/build'
Linking CXX executable owcrashreport
cd /home/margaret/Downloads/skype_alts/qutecom-2.2.1/build/crashreport && /usr/b
in/cmake -E cmake_link_script CMakeFiles/owcrashreport.dir/link.txt --verbose=1
/usr/lib/ccache/c++ -g -lpthread CMakeFiles/owcrashreport.dir/moc_FtpUpload.o
CMakeFiles/owcrashreport.dir/moc_QtCrashReport.o CMakeFiles/owcrashreport.dir/m
ain.o CMakeFiles/owcrashreport.dir/FtpUpload.o CMakeFiles/owcrashreport.dir/QtCr
ashReport.o -o owcrashreport -rdynamic -L/home/margaret/Downloads/skype_alts/qu
tecom-2.2.1/build/libs/owutil/cutil -L/home/margaret/Downloads/skype_alts/quteco
m-2.2.1/build/libs/owutil/util -L/home/margaret/Downloads/skype_alts/qutecom-2.2
.1/build/libs/owutil/thread -L/home/margaret/Downloads/skype_alts/qutecom-2.2.1/
build/libs/owutil/system -L/home/margaret/Downloads/skype_alts/qutecom-2.2.1/bui
ld/libs/qtutil -L/home/margaret/Downloads/skype_alts/qutecom-2.2.1/build/libs/ow
util/serialization -L/home/margaret/Downloads/skype_alts/qutecom-2.2.1/build/lib
s/owutil/settings -L/home/margaret/Downloads/skype_alts/qutecom-2.2.1/build/libs
/3rdparty/tinyxml ../libs/owutil/cutil/libowcutil.a -lboost_program_options -lbo
ost_serialization -lboost_signals -lboost_thread-mt -luuid ../libs/owutil/util/l
ibowutil.so ../libs/owutil/thread/libowthread.a ../libs/owutil/system/libowsyste
m.a -lcurl -lQtDBus_debug -Wl,-Bstatic -lQtUiTools_debug ../libs/qtutil/libowqtu
til.a ../libs/owutil/serialization/libowserialization.a ../libs/owutil/settings/
libowsettings.a -Wl,-Bdynamic -lQtDBus_debug -Wl,-Bstatic -lQtUiTools_debug -Wl,
-Bdynamic -lSM -lICE -lX11 -lXext -lXft -lXau -lXv ../libs/owutil/thread/libowth
read.a ../libs/owutil/serialization/libowserialization.a ../libs/owutil/util/lib
owutil.so ../libs/owutil/cutil/libowcutil.a -lboost_program_options -lboost_seri
alization -lboost_signals -lboost_thread-mt -luuid ../libs/3rdparty/tinyxml/libt
inyxml.a -Wl,-rpath,/home/margaret/Downloads/skype_alts/qutecom-2.2.1/build/libs
/owutil/util
/usr/bin/ld: CMakeFiles/owcrashreport.dir/moc_QtCrashReport.o: undefined referen
ce to symbol 'QObject::childEvent(QChildEvent*)'
/usr/bin/ld: note: 'QObject::childEvent(QChildEvent*)' is defined in DSO /usr/li
b/libQtCore.so.4 so try adding it to the linker command line
/usr/lib/libQtCore.so.4: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make[2]: * [crashreport/owcrashreport] Error 1
make[2]: Leaving directory `/data/home/margaret/Downloads/skype_alts/qutecom-2.2
.1/build'
make[1]: * [crashreport/CMakeFiles/owcrashreport.dir/all] Error 2
make[1]: Leaving directory `/data/home/margaret/Downloads/skype_alts/qutecom-2.2
.1/build'
make: * [all] Error 2
comment:8 Changed 23 months ago by laurent
-lQtCore_debug is missing ...
Could you post your CMakeCache.txt ?
Changed 23 months ago by gbell12
comment:9 Changed 23 months ago by gbell12
Happy to - it's there now. Thanks for all the help.
comment:10 Changed 23 months ago by laurent
- Resolution set to fixed
- Status changed from new to closed
comment:11 Changed 23 months ago by gbell12
How do I get that fix? I don't see the change committed on the 2.2 repo...
comment:12 Changed 23 months ago by laurent
- Resolution fixed deleted
- Status changed from closed to reopened
oups i really sorry gbell12 .. i thought that this problem was solved
comment:13 Changed 23 months ago by laurent
looking at CMakeCache.txt
It seems that qt4_LIBRARIES variable is not correct
qt4_LIBRARIES:INTERNAL=/usr/lib/libQtDBus_debug.so;/usr/lib/libQtUiTools_debug.a
Have you installed complete Qt4 dev package after your first QuteCom configure ...
Can you erase your current CMakeCache.txt, reconfigure and send me the new created CMakeCache.txt ?
comment:14 follow-up: ↓ 15 Changed 23 months ago by gbell12
Have you installed complete Qt4 dev package after your first[[BR]] QuteCom configure ...
Qt4 dev package has been installed the whole time.
qt4_LIBRARIES:INTERNAL=/usr/lib/libQtDBus_debug.so;/usr/lib/libQtUiTools_debug.a
Both of those files exist and are readable.
I updated the Qt4 dev packages from the RPM repos, re-cmake'd, but the CMakeCache.txt was the same...
comment:15 in reply to: ↑ 14 Changed 23 months ago by laurent
Replying to gbell12:
I updated the Qt4 dev packages from the RPM repos, re-cmake'd, but the CMakeCache.txt was the same...
i really don't know why qt4_LIBRARIES variable is not correctly set ...
looking at http://trac.qutecom.org/browser/qutecom-2.2/libs/3rdparty/qt4/CMakeLists.txt
QT_QTCORE_LIBRARY_DEBUG and QT_QTGUI_LIBRARY_DEBUG should be added to qt4_LIBRARIES ...
looking at your CMakeLists.txt
QT_QTCORE_LIBRARY_DEBUG and QT_QTGUI_LIBRARY_DEBUG are not null ...
Did you erase CMakeCache.txt before cmake ?
comment:16 Changed 23 months ago by laurent
Just installed a fresh fedora. I can reproduce the problem IF qt-webkit-devel is not installed ( comment:1 )
Fedora does not provide qt-webkit-devel with qt-devel package ....
Have you installed qt-webkit-devel ?
How to fix :
sudo yum install qt-webkit-devel
erase CMakeCache.txt + re-cmake
comment:17 Changed 23 months ago by gbell12
It builds! So was that user error or should cmake have yelled at me?
comment:18 Changed 23 months ago by dneary
Unfortunately, with different distributions packaging software like Qt in different ways, it's really hard to write CMake rules that check for everything we need everywhere. I guess this counts as a build script bug :)
comment:19 Changed 23 months ago by laurent
- Resolution set to fixed
- Status changed from reopened to closed
bug fix : 700

Did you see this https://bugs.launchpad.net/ubuntu/+source/qutecom/+bug/667159 ?