[texworks] Compilationerror for Mingw and printing

Alain Delmotte esperanto at swing.be
Sun Jun 21 22:30:38 CEST 2009


Hi again, :-)

Stefan Löffler a écrit :
> But we've passed compilation and are at linking now. That's progress
> after all :).
> My first guess would be that you somehow removed the
>    LIBS +=lgdi32
>    LIBS +=lole32
> lines again, at least I don't see them in the command line. If not, than
> apparently the function is implemented in another library in your
> installation. All I can tell you is that it's bound to be one of the .a
> files in MinGW\lib, but which one I don't know. Otherwise, the only
> solution I can think of right now is to comment out the whole code between
> #if defined(Q_WS_WIN)
> and
> #endif
> (which didn't do anything for me, anyway ;).
>   
The lines were missing, they disappeared during trials. But following 
your comment I went to MinGW\lib and there was no gdi32 nor ole32, but 
"libgdi32.a" and "libole32.a"
So I changed TeXworks.pro lines to
    LIBS += -libgdi32   and
    LIBS += -libole32
The compilation gave the following error:
g++ -enable-stdcall-fixup -Wl,-enable-auto-import 
-Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release/TeXworks.exe 
object_sc
ript.TeXworks.Release  -L'c:/Programmes/KDE-mingw/bin/../lib' -lmingw32 
-lqtmain
 -LC:/texworks-mingw/hunspell-1.2.8/src/hunspell/.libs -lpoppler-qt4 
-lhunspell-
1.2 -libgdi32 -libole32 -lQtXml4 -lQtGui4 -lQtCore4
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: 
cannot fin
d -libgdi32
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release/TeXworks.exe] Error 1
mingw32-make[1]: Leaving directory `C:/texworks-mingw/texworks'
mingw32-make: *** [release] Error 2

or with:
    LIBS += -llibgdi32   and
    LIBS += -llibole32
g++ -enable-stdcall-fixup -Wl,-enable-auto-import 
-Wl,-enable-runtime-pseudo-rel
oc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o release/TeXworks.exe 
object_sc
ript.TeXworks.Release  -L'c:/Programmes/KDE-mingw/bin/../lib' -lmingw32 
-lqtmain
 -LC:/texworks-mingw/hunspell-1.2.8/src/hunspell/.libs -lpoppler-qt4 
-lhunspell-
1.2 -llibgdi32 -llibole32 -lQtXml4 -lQtGui4 -lQtCore4
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: 
cannot fin
d -llibgdi32
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release/TeXworks.exe] Error 1
mingw32-make[1]: Leaving directory `C:/texworks-mingw/texworks'
mingw32-make: *** [release] Error 2


So I deleted the 2 lines and commented the #if ... #endif (in 
PDFDocument.cpp) and it compiled and it works for printing the source 
(keeping the highlighting colors) and creating the image for the PDF 
(printing to pdfcreator also works -- to print only one page you have to 
enter 2-2 not only 2).

There were some warnings about unused variables and about something with 
Javascript???

I'll put it on my site for testing by others (tomorrow).

Good night and thanks,

Alain



More information about the texworks mailing list