msvc toolkit compiler build
Bernhard Reiter
bernhard at intevation.de
Thu Mar 30 18:26:01 CEST 2006
Didrik,
Am 30. Mar 2006 um 18:10:00 schrieb Didrik Pinte:
> Le jeudi 30 mars 2006 à 15:53 +0200, Didrik Pinte a écrit :
> > Le mercredi 29 mars 2006 à 12:10 +0200, Bernhard Reiter a écrit :
> > Good news, there is no need for the full MSVC 7.1 for building
> > extension on Windows. The Microsoft Visual C++ Toolkit Compiler (a.k.a.
> > MS Toolkit Compiler) is available freely and can do the trick.
> >
> > I've followed the following steps and it seems to work :
> > http://www.vrplumber.com/programming/mstoolkit/
> >
> > 1) The first correction to thuban/libraries/thuban/wxproj.cpp:
> > adding a #undef LP in a line right after the #undef PVALUE
> >
> > 2) I've updated the setup.py to the wx26 directory and inclusion
>
> Great, it's working.
wonderful.
Thanks for the great description!
Now I am curious about your tests.
If they run fine, it would be grant to provide a package of some kind
for others to play with.
To get it done with MinGW is getting less important now,
though it will stay interesting to some point as this might allow
crosscompilation under GNU/Linux in the future. That is, if we
figure out how to do it. ;)
> Here are the steps i've followed.
>
> [1] The error was because of a bad use of sqrt function in wxproj.cpp.
>
> The following correction made the trick :
> line 468 :
> len = (long)sqrt(vx * vx + vy * vy);
> becomes :
> len = (long)sqrt((float)vx * vx + vy * vy);
I would not say this is bad usage of sqrt, but if the explicit cast helps
the microsoft compiler, why not. :)
I wounder if (double) would also be fine and more precise,
but it might also hit speed.
> [2] Downloaded and build proj 4.4.6
>
> [3] Adapted path to have nmake.exe and lib.exe in the path (from
> Platform sdk)
Where did you change this?
>
> [4] Removed ctl3d32.lib from the setup.py
>
> [5] Downloaded and build gdal 1.3.1
>
> [6] Missing for building gdal, I've created msvcprt.lib
> (http://libsh.org/win32/build.html ) :
> echo LIBRARY msvcp71.dll > msvcprt.def
> echo EXPORTS >> msvcprt.def
> lib -dump /exports msvcp71.dll | sed -nf exports.sed >> msvcprt.def
> lib /def:msvcprt.def /machine:x86
>
> [7] Problem of MSVCtoolkit in C:\Program Files\Microsoft Platform SDK
> \Include\atlPSDK\Include\atl\atlbase.h. The include of atlthunk.lib is
> not possible because not given with the environment (same with
> VisualStudio Express 2005). You need to remove the following line :
> 293 : #pragma comment(lib, "atlthunk.lib")
>
> See :
> http://www.cs.northwestern.edu/~ayman/blog/archives/2006/01/12/link-error-be-damned/
>
> ! if you have the problem, clean the build system before retrying
>
> [8] added gdal\gcore to the list of includes :
> gdal_inc = [os.path.join(gdal_prefix, 'alg'),
> os.path.join(gdal_prefix, 'ogr'),
> os.path.join(gdal_prefix, 'port'),
> os.path.join(gdal_prefix, 'gcore'),
> os.path.join(gdal_prefix, 'core')]
>
> Then:
>
> python setup.py build
> python setup.py install
>
> worked fine... now i need to test it.
It would be cool to have a set of diffs against Thuban's files,
so we can commit these changes permanently.
Thanks,
Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.intevation.de/pipermail/thuban-devel/attachments/20060330/4557d195/attachment.bin
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)