3
votes

So I'm trying to build Maliit Framework https://github.com/maliit using Qt Creator on a Windows machine. I have fixed several windows compatibility issues so far: https://github.com/RHawkeyed/framework. But now I get this error: undefined reference to 'DummyInputMethod3::staticMetaObject' in qobject.h

From answers to similar problems I found through google, this is often caused by not defining the qobject in a header, forgetting to add Q_OBJECT macro or moc not running properly. This does not seem to be the case here as DummyInputMethod3 is defined in its own header:

class DummyInputMethod3 : public MAbstractInputMethod
{
    Q_OBJECT

    ...

And moc_dummyinputmethod3.cpp is generated in the path I would expect.

Also the header file is listed in the pro file as it should be:

HEADERS += \
    dummyimplugin3.h \
    dummyinputmethod3.h \

Any ideas about what might be wrong?


Getting the error when compiling this:

https://github.com/RHawkeyed/framework

in Qt Creator 3.5.0 using MinGW 4.9.2 32bit and Qt 5.5.0

The qmake files make use of several linux commands so I have added cygwin https://www.cygwin.com/ to the system path.


Compiling with msvc

I am not bound to a specific compiler, I just need to compile for windows. Compiling with msvc is perfectly acceptable. Actually I started out trying to compile with msvc, but after running into a number of problems and seeing suggestions that it is meant to be compiled with mingw I tried that instead. Anyway I can now compile up to the same error in both mingw and msvc:

https://github.com/RHawkeyed/framework

in Qt Creator 3.5.0

Qt 5.5

MSVC2013 32 bit

1
If everything else is OK, then MAbstractInputMethod does not derive from QObject. Alas, please first delete the entire build folder (build-... above your source folder) and build again.Kuba hasn't forgotten Monica
@KubaOber I have already cleaned, run qmake and rebuild a couple of times, just tried again in a new build folder, same problem. And it does derive from QObject class MAbstractInputMethod: public QObject { Q_OBJECTRHawkeyed
I'll take a peek, but since this is for fun I won't touch MinGW with a long pole. I'll see if it can compile with MSVC 2012 or 2015.Kuba hasn't forgotten Monica
@KubaOber Hi :) Have you had a chance to give it a try yet? Compiling with msvc is perfectly fine, I actually tried that first. But after I ran into several compilation errors and saw mingw mentioned in one of the .pro files, I tried mingw instead. I have made a few more changes and I can now get it to compile up to the same error with both compilers. I normally use msvc2013, but I also tried compiling with msvc2012 and it behaves the same.RHawkeyed

1 Answers

0
votes

I am fairly certain I have solved this particular problem correctly. Import/export is needed for windows dlls. It happens automatically on linux. So much for maliit being cross platform.

I still don't have maliit keyboard working properly. The example app starts, however I can't get the keyboard to show. Anyway that is for another question, that is if I don't just abandon this altogether.

My current progress is on github:

https://github.com/RHawkeyed/framework

https://github.com/RHawkeyed/plugins