[texworks] Building TeXworks on Windows using MinGW

Stefan Löffler st.loeffler at gmail.com
Sun Jun 14 12:50:12 CEST 2009

Hi again,

On 2009-06-14 11:11, T T wrote:
> On 14/06/2009, Stefan Löffler <st.loeffler at gmail.com> wrote:
>> On 2009-06-14 02:08, T T wrote:
>>> Aren't those KDE libs supposed to work? I chose the ones for mingw in
>>> KDE installer. I'm stuck :(
>> Yes, they are supposed to work. I think I had a similar problem, but I
>> think you won't be able to confirm that because MinGW doesn't come with
>> a dll dependency walker. In my case, this problem didn't come from QtGui
>> directly (as used in TW). Instead, poppler-qt4 used an incompatible
>> version of QtGui - don't ask me how this could happen. In any case, the
>> problem was solved for me by reinstalling (at least) poppler-qt4 and
>> poppler from a different server (the one that was broken in my case was
>> a french server). If this doesn't help, try reinstalling the rest of the
>> libraries, and probably rebuilding TW to be on the safe side.
> Didn't work :( I tried several KDE mirrors with the same results.
> If what you say is true, that would really suck. How people are
> supposed to know which KDE mirror to use? Do you remember which one
> you used?

I didn't, but I looked it up ;). It was
Another thing one could try would be to use an older version (4.2.2 and
4.2.1 are available, I think), or the unstable branch.

> Does gcc version matters? I have gcc 3.4.5 (mingw-vista special r3).

It shouldn't, since the code compiles and links correctly. You do get a
TeXworks.exe, it's just having problems starting up because of a problem
with poppler-qt4. (Btw, I think I have the same version of gcc).

>> If this still doesn't work: the dependecy walker can apparently be
>> downloaded at http://www.dependencywalker.com/. It's not an easy tool to
>> use (it's intended for hard-core developers ;)), but if you see a red
>> QtGui.dll under libpoppler-qt4 on the left which - when you click on it
>> - displays a single red line on the right giving the function you posted
>> (_ZN8QPPaiter9drawImageERK7QPointFRK6QImage) it's probably the same issue.
> Yes, that's what I see, _ZN8QPainter9drawImageERK7QPointFRK6QImage as
> the only one in red. QtGui4.dll contains
> _ZN8QPainter9drawImageERK6QRectFRK6QImageS2_6QFlagsIN2Qt19ImageConversionFlagEE.
> What am I supposed to do about it?

Hm, I'm down to guessing here (especially since it worked for me). So,
first of all, I suggest you try out the mirror I posted above. If that
works, maybe the simplest thing will be to simply copy those files to
the TW page if the license allows that. Of course we'd have to check for
updates (and a working poppler lib) every now and then, but if that's
the only simple solution...

Some other things you could try:
Sourceforge is also hosting KDE on Windows files. So you could go to
and download poppler-mingw-0.10.6-bin.tar.bz2. That should contain the
dlls. I don't know if they have the same issue, but maybe they work.

The last option would be to compile poppler ourselves. If that's as
simple as compiling hunspell, it's not ideal but it's viable.
Unfortunately, I haven't tried that yet. The sources are available at
http://poppler.freedesktop.org/, and I found some messages from a while
back (2008) about fixing poppler so that it compiles using mingw. Don't
know if that works right now, though. If it does, I'd expect something
like the following to work: extract the libs to your TW directory so you
get something like c:\texworks\poppler-0.10.7 alongside the hunspell
dir. Then run MSYS and type
    cd /c/texworks/poppler-0.10.7
I can't predict what will happen, though. It may fail already during
configure. The most likely cause for that would be that some extra tools
are not installed (I don't know if poppler relies and either automake,
autoconf, or CMake), or that it doesn't find glib (an important library
on linux systems (and hence for mingw) that should also be available for
windows - I just don't remember where ;)).
It could also be that (some of) the tools and libs don't compile
properly, but the one we need does (this happens in the case of poppler,
for example; I just navigated you around all those parts that don't
compile ;)).
In any case, if you try this, please post the result. Maybe I can figure
out what's wrong (I still hope one of the previous approaches will work).

BTW: If it succeeds, you need to locate a file probably called something
like "libpoppler-qt4.a" or "libpoppler-qt4.la". Then replace the line
    INCLUDEPATH += C:/KDE/include/poppler/qt4
in TeXworks.pro by
    INCLUDEPATH += C:/KDE/include/poppler/qt4
and add the following:
    LIBS += -LC:/texworks/poppler-0.10.7/<path-to-libpoppler-qt4.a>


More information about the texworks mailing list