[texworks] Compiling on windows with Mingw

Stefan Löffler st.loeffler at gmail.com
Mon Dec 14 07:36:14 CET 2009


it's great that the building process works now. There's still the issue
with manually tampering with the Makefiles, though, which I'd like to
resolve before updating the guide.

On 2009-12-13 21:55, Ignasi Furió wrote:
> El Sun, 13 Dec 2009 15:54:44 +0100, Stefan Löffler
> <st.loeffler at gmail.com> vau escriure:
>> 4) Add the following lines to your TeXworks.pro (in the place where
>> you edit
>> it before):
>>     QT =
>>     LIBS += -lQtScript4 -lQtScriptTools4 -lQtXml4 -lQtGui4 -lQtCore4
> I've included in win32 part which looks like
> win32 { # paths here are specific to my setup
>     INCLUDEPATH += D:/KDE/include/poppler/qt4
>     INCLUDEPATH += D:/texworks/hunspell-1.2.8/src/hunspell
>     LIBS += -LD:/texworks/hunspell-1.2.8/src/hunspell/.libs
>     LIBS += -lpoppler-qt4
>     LIBS += -lhunspell-1.2
>     QT =
>     LIBS += -lQtScript4 -lQtScriptTools4 -lQtXml4 -lQtGui4 -lQtCore4
>     RC_FILE = res/TeXworks.rc
> }
> after qmake and mingw32-make the result shows things like:
> ....
> g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE
> -DQT_NEEDS_QMAIN -I'../../kde/include' -I'src'
> -I'../../KDE/include/poppler/qt4' -I'../hunspell-1.2.8/src/hunspell'
> -I'../../kde/include/ActiveQt' -I'moc' -I'ui'
> -I'../../kde/mkspecs/default' -o obj/main.o src/main.cpp
> En el fitxer inclòs dès de src/main.cpp:22:
> src/TWApp.h:25:24: error: QApplication: No such file or directory
> src/TWApp.h:26:17: error: QList: No such file or directory
> src/TWApp.h:27:19: error: QAction: No such file or directory
> src/TWApp.h:28:21: error: QSettings: No such file or directory
> ...
> It seems that some referenc to .h files is wrong or missing.

Yeah, you're essentially right. They refer to header files (though they
don't have any extension; but then again they include the correct
(platform dependent?) .h files).

> After that I've commented QT= line in TeXworks.pro. Now qmake
> generates a Makefile.Release file where LIBS line contains
> references to Qt4 libs and Qt. I've deleted these ones and leaved only
> Qt4 libs. Now I obtained TeXworks.exe into Release folder. It works if
> I include all recommended dll in wiki page plus QtScript4 and
> QtScriptools4.

OK. Actually, I consider this a Qt/KDE bug. Normally, qmake should
produce valid Makefiles. Anyway, we have to work around this somehow for
the time being. I see several possibility for this:
1) Change the LIBS line in Makefile.Release, as you did. The problem I
have with this is that the Makefile gets generated (and hence
overwritten) automatically
2) Rename the files in %KDE%\libs. Not ideal, either, since they may
have some reason for naming the things the way they do. Besides, this
might break other builds...
3) Going with the "QT = " line and including the include paths manually.
This would make qmake essentially useless, though.
4) Try adding the following two lines instead of the previously
suggested workaround:
    LIBS -= -lQtScript
    LIBS += -lQtScript4

I favor option 4 for now. If it works, it would probably be the most
elegant workaround. If this doesn't work, we may have to return to the
"QT =" solution, although my last approach was a bit extreme (after all
it's only the QtScript part that causes trouble, IIRC).


More information about the texworks mailing list