np43 / qextserialport

Automatically exported from code.google.com/p/qextserialport
Other
0 stars 0 forks source link

Link error on Mac Os X 10.7 with Qt 4.8 #135

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I am trying to compile a static library with the following .pro

TEMPLATE = lib
CONFIG += warn_off staticlib
VERSION = 1.2.0

HEADERS                += src/qextserialport.h \
                          src/qextserialenumerator.h \
                          src/qextserialport_global.h \
                          src/qextserialport_p.h \
                          src/qextserialenumerator_p.h \

SOURCES                += src/qextserialport.cpp \
                          src/qextserialenumerator.cpp \
                          src/qextserialport_unix.cpp \
                          src/qextserialenumerator_osx.cpp

INCLUDEPATH += src
DEPENDPATH += src

It fails with the following link error:

Undefined symbols for architecture x86_64:
  "QObject::last_event(QEvent*)", referenced from:
      vtable for QextSerialPortin libqextserialport-1.a(qextserialport.o)

If I simply add the following line (what an horrible hack, I reckon) at the end 
of qserialport.cpp:

bool QObject::last_event(QEvent *) {
    return false;
}

Then everything works like a charm. Since qextserialport is written using the 
internal Qt mechanism (for pimpling) and uses the approach of #include "moc_" 
for calling the moc, I am a bit lost, and cannot figure out why there is the 
linkage error in the first place.

Original issue reported on code.google.com by xavier.d...@gmail.com on 15 Jun 2012 at 10:51

GoogleCodeExporter commented 9 years ago
Hi

Thanks for your work. but I can not reproduce this issue in my system.

I have made a cleanup in the build-system in current-head-sources, Maybe you 
can give a try too.

http://code.google.com/p/qextserialport/wiki/QextSerialPort_1_2_RC

Original comment by dbzhang...@gmail.com on 16 Aug 2012 at 7:47