Unable to link mtest in Windows QT 5.6 QtCreator 4.0+ unless I disabled OMR

• Oct 7, 2016 - 08:09

I couldn't figure out why the linking step would fail. poppler code had all these errors about not being able to find setAttribute for QDomElement http://doc.qt.io/qt-5/qdomelement.html ...which sounds like somehow the windows build code is not including QtXML (or something else?) in the linking step. I couldn't quite figure out how to debug an mtest other than by disabling OMR in the toplevel CMakeLists. Just seeing if anyone else has experienced this or knows the solution.


Comments

I found the same both under Windows and when running cross-compiled tests with Wine under Linux.
It is a problem of linking order in the dependencies; I don't know why it doesn't appear also under Linux. Poppler seems to depend on QtXML, but Qt libraries are included before Poppler in mtest/cmake.inc.
If ${QT_LIBRARIES} is added after poppler here , this part of the compilation goes ok, i.e: target_link_libraries(${TARGET} omr poppler ${QT_LIBRARIES})

However, there is also a problem with Zerberus tests when running the tests under Windows since the result of size() instruction is not an unsigned long under 32bit Windows, for example here and in other Zerberus tests.
I locally solved it by using quintptr instead of unsigned long (see //doc.qt.io/qt-5/qtglobal.html#quintptr-typedef ), but I don't know if it is the correct type to be used.

There is also a rounding problem in the fourth decimal digit in one of the tests for one articulation (i.e. under Windows it is different than under Linux), but maybe the recent change to articulations solved it (I didn't check Windows tests last week).

Ciao,
ABL

In reply to by ABL

thanks for that info! If a simple reordering to the cmake.inc fixes that linking, then can you or someone submit a PR for that?

Regarding size(), I haven't looked closely into that code, but I do know that there is a special type of unsigned int called size_t which is what is supposed to be used to hold the result of size() operation. Is size_t the answer here?

EDIT: oh wait...I'm thinking that size_t is for sizeof() operation, which is something differnet.

Anyway, my vote would be to use the qt construct, since qt goes to great length to make their things as cross-platform as possible.

Do you still have an unanswered question? Please log in first to post your question.