[texworks] Compiling on windows with Mingw
st.loeffler at gmail.com
Mon Dec 14 18:43:12 CET 2009
On 2009-12-14 13:19, Ignasi Furió wrote:
>> 4) Try adding the following two lines instead of the previously
>> suggested workaround:
>> LIBS -= -lQtScript
>> LIBS += -lQtScript4
> Even with this two lines and after qmake Makefile.Release contains
> next LIBS declaration:
> LIBS = -L"d:\kde\bin\..\lib" -lmingw32 -lqtmain .\obj\TeXworks_res.o
> -LD:/texworks/hunspell-1.2.8/src/hunspell/.libs -lpoppler-qt4
> -lhunspell-1.2 -lQtScript4 -lQtScript -lQtScriptTools -lQtXml -lQtGui
> I don't find where, but -lQtScript -lQtScriptTools -lQtXml -lQtGui
> -lQtCore are added by default.
At least this I can explain. QtGui and QtCore are always added
automatically. The other three are specified by the line "QT += xml
script scripttools". Nevertheless, qmake apparently creates
specifications that (at least) the gcc 4.x compilers don't understand. I
consider this a bug, though whether it's one of Qt, of KDE on Windows,
or of mingw/gcc I can't really tell.
I've come up with a new workaround now. If you create a file named
"fixQtLibs.bat" containing the lines
copy "%KDEPATH%\lib\libQtScript4.a" "%KDEPATH%\lib\libQtScript.a"
copy "%KDEPATH%\lib\libQtScriptTools4.a" "%KDEPATH%\lib\libQtScriptTools4.a"
copy "%KDEPATH%\lib\libQtXml4.a" "%KDEPATH%\lib\libQtXml4.a"
copy "%KDEPATH%\lib\libQtGui4.a" "%KDEPATH%\lib\libQtGui4.a"
copy "%KDEPATH%\lib\libQtCore4.a" "%KDEPATH%\lib\libQtCore4.a"
and add the line
QMAKE_PRE_LINK = 'fixQtLibs.bat'
to TeXworks.pro, things should work. What this does is that it simply
runs the batch file "fixQtLibs.bat" before linking the application. In
the batch file, the library files with the suffix 4 are copied to files
without that suffix. This way, the linker finds the files it expects,
which are identically the same as the ones distributed by KDE on
Windows. Of course one could also copy these files manually, but this
would cause problems when updating the KDE on Windows libs. Does this
work for you?
BTW: I had to install the libpng package from KDE as well. Otherwise, Tw
built fine, but when I ran it it complained about the missing png dll. I
used a fairly virgin installation, though (in a Linux virtual machine
;)), so you may already have that dll available from elsewhere.
More information about the texworks