Microsft VC7 Toolkit compiler

Herman Oudejans hn.oudejans at quicknet.nl
Sat Mar 26 21:10:38 CET 2005


Hi, 

 

Really great work porting the QT libs to windows. I was trying the non-free
version (since QT isn't released yet), but this is much better.

Anyway,

 

I have managed to compile the libs and examples with just the free Microsoft
stuff and I thought I should share this.

Here is the way I did it.

 

1) Preparations

 

Download and install the following:

 

Toolkit compiler: http://msdn.microsoft.com/visualc/vctoolkit2003/

Platform SDK:
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/downlevel.htm
(Please take the 2003 version!!)

Dotnet Runtime:
http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589-4842-
8157-034D1E7CF3A3
<http://www.microsoft.com/downloads/details.aspx?FamilyId=262D25E3-F589-4842
-8157-034D1E7CF3A3&displaylang=en> &displaylang=en

Framework SDK:
http://www.microsoft.com/downloads/details.aspx?FamilyID=9b3a2ca6-3647-4070-
9f41-a333c6b9181d
<http://www.microsoft.com/downloads/details.aspx?FamilyID=9b3a2ca6-3647-4070
-9f41-a333c6b9181d&displaylang=en> &displaylang=en

Sed: http://www.student.northpark.edu/pemente/sed/gsed407x.zip (make sure
it's in your path somewhere)

 

Copy msvcrt.lib to the Toolkit compiler lib directory (it was installed by
the Framework SDK).

 

You can create msvcprt.lib with this batchfile:

 
echo LIBRARY msvcp71.dll > msvcprt.def
echo EXPORTS >> msvcprt.def
dumpbin /exports msvcp71.dll | sed -nf exports.sed >> msvcprt.def
lib /def:msvcprt.def /machine:x86

 

(lib.exe and dumpbin.exe are found in the bin/win64 directory of the
platformSDK 2003)

 

and the following sed script

 

# exports.sed - Copyright (C) 2001 Pat Thoyts <Pat.Thoyts at bigfoot.com>

#

# Build an exports list from a Windows DLL.

#

/[          ]*ordinal hint/,/^[             ]*Summary/{

  /^[       ]\+[0123456789]\+/{

    s/^[   ]\+[0123456789]\+[ \t]\+[0123456789ABCDEFabcdef]\+[
]\+[0123456789ABCDEFabcdef]\+[          ]\+\(.*\)/\1/p

  }

}

 

Copy this to the toolkit compiler lib directory too.

 

Finally copy this text and call it nodelay.bat:

 

@echo off

type nodelay.bat | sed -ne "s/^ACT \(.*\)/\1/p" > act.bat 

dir /w/s/b Makefile%1 | sed -e "s/\(.\):\\/@call act \1:\\/" > process.bat

call process.bat

echo Cleaning up ...

del process.bat

del act.bat

del temp.mak

del temp1.mak

goto finish

ACT @echo off

ACT echo Processing %1 ...

ACT copy %1 temp.mak > nul

ACT sed -e "s/\/DELAYLOAD:[^ ]*//g" -e "s/\"delayimp.lib\"//g" -e
"s/delayimp.lib//g" temp.mak > temp1.mak

ACT copy temp1.mak %1 > nul

:finish

 

2) Setting up the environment

 

This is actually quite an easy step.

-          Start a dosprompt

-          run setenv.bat from the PlatformSDK2003 directory

-          run vcvars32.bat from the Toolkit compiler directory

-          Add the PlatformSDK2003\bin\win64 directory to your path (for
nmake and other utils)

-          Setup Qt environment (taken from the QT-win/free homepage)

     c:\source> set QTDIR=< qt3 source root>
     c:\source> set PATH=%QTDIR%\bin;%PATH%
     c:\source> set QMAKESPEC=win32-msvc.net

 

3) compiling

 

-          place nodelay.bat in your QT3 root directory (and make sure sed
is somewhere in your path)

-          type:   nodelay .win32-msvc.net

-          run configure.bat

-          wait till it gives an error (yes, it's suppose to do that)

-          run nodelay.bat without parameters

-          run nmake

 

4) Enjoy your QT (I'm sure I don't need to spell out how to do that ;)

            

Remarks:

 

This tutorial was created using various source on the net. E.g. how to
compile the wxWidgets library. Except for the nodelay.bat and putting it all
together, none of this is my own creation.

 

The nodelay.bat removes /DELAYLOAD:xxxxx.lib and delayimp.lib from the
makefiles. Although vs6 and vs dotnet have the delayimp.lib, the free
version doesn't and I didn't find any way to download it legally. QMake
places these options in the makefiles and starts compiling right away, so
there was no way for me to do it without any errors. It would be nice if
there would be a win32-msvc.tc or something without those annoying options.
Even better would be to provide a custom version of delayimp.lib, but I have
no idea how to do that (yet).

 

Tcm1998, openMSX-Catapult (GPL) developer

 

 

 

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-cygwin/attachments/20050326/54551901/attachment-0001.html


More information about the kde-cygwin mailing list