help compiling Python on vs 2008!

I

inhahe

In order to compile Python, I need to compile 7 external libraries manually
that don't come with Python, the first being tcl. I'm compiling on VS 2008.
Since the Python source doesn't have a PCBuild9 directory, I'm using the
PCBuild8 directory. When following readme.txt to a T, tcl won't compile.
First it gave me an error because an environment variable wasn't set, so I
dug in and found out what needs to be set (MSDEVDIR, MSVCDIR, or MSSDK) and
set it. Not that I know what it needs to be set to, but I made a good guess
based on some google searches. Now I don't get that error, but I get a
truckload of C errors when compiling.
Here's the first one, or actually, all the output up to and including the
first C error:

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

===============================================================================
*** Compiler has 'Optimizations'
*** Compiler has 'Pentium 0x0f fix'
*** Linker has 'Win98 alignment problem'
*** Intermediate directory will be '.\Release\tcl_Dynamic'
*** Output directory will be '.\Release'
*** Suffix for binaries will be ''
*** Optional defines are ''
*** Dependency rules are not being used.

cl -nologo -c -W3 -YX -Fp.\Release\tcl_Dynamic\ -QI0f -O2 -Op -Gs -MD -I
"..\win" -I"..\generic" -DTCL_PIPE_DLL=\"tclpip84.dll\" -DBUILD_tcl -Fo.\Relea
se\tcl_Dynamic\ @E:\Users\ADMINI~1\AppData\Local\Temp\nmD926.tmp
cl : Command line warning D9002 : ignoring unknown option '-YX'
cl : Command line warning D9002 : ignoring unknown option '-QI0f'
cl : Command line warning D9002 : ignoring unknown option '-Op'
regerror.c
...\generic\regerror.c(53) : warning C4996: 'errcode': This name was
supported du
ring some Whidbey pre-releases. Instead, use the standard name errno_t.
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\crtdefs.h(548) :
see declaration of 'errcode'
...\generic\regerror.c(53) : error C2081: 'preg' : name in formal parameter
list
illegal


what is going on here, and how do I compile these external libraries?
 
C

Christian Heimes

inhahe said:
what is going on here, and how do I compile these external libraries?

I assume you are trying to compile Python 2.5 with VS 9.0. It's not
supported. Some extensions don't compile under VS 9.0

Christian
 
I

inhahe

Christian Heimes said:
I assume you are trying to compile Python 2.5 with VS 9.0. It's not
supported. Some extensions don't compile under VS 9.0

Christian

I just installed Visual Studio 8 and tried compling and I bgot the same
problem. hope this isn't a redundant post. i don't know if
(e-mail address removed) reposts here.
 
C

Christian Heimes

Matthieu said:
Hi,

I did not manage to build extension with distutils with Python compiled with
VS different than 2003. The need for 2003 was hard-coded in distutils.
You can try building extensions with VS2008 with Scons. This is what I do a
lot, and everything works fine as long as the interface does not use
standard structures (like FILE, custom structures are fine) or objects
allocated in the extension is freed in the extension.

Python 2.5 is compiled with VS 2003. Neither VS 2005 nor 2008 are
officially supported.

You can compile extensions with a different version of MS VC but it can
get you in a lot of trouble. Every version of the VS Compiler uses its
own C Runtime Library (MSVCRT). You can't share some resources like
allocated memory and FILE* objects between MSVCRTs.

Christian
 
C

Christian Heimes

Matthieu said:
Even if you compile Python 2.5 with VS2008, VS2003 is used for the
extensions, AFAIR. I didn't try Python 2.6 because I only have Visual C++
Express 2008.

You can compile 2.6 and 3.0 with the free Express Edition just fine.

Christian
 
C

Colin J. Williams

inhahe said:
I just installed Visual Studio 8 and tried compling and I bgot the same
problem. hope this isn't a redundant post. i don't know if
(e-mail address removed) reposts here.
You might consider working with Python
2.6, which does compile with Visual
Studio C++ 2008 and running the test
(Tools\Buildbot\rt.bat) produces very
few errors. Just remember that 2.6 is
tsill at the alpha stage of development.

Colin W.
 
I

inhahe

VS2005 seems to be officially supported. Here's part of the readme file in
the PCBuild8 directory in the Python 2.5 source.

"
Building Python using VC++ 8.0
-------------------------------------
This directory is used to build Python for Win32 platforms, e.g. Windows
95, 98 and NT. It requires Microsoft Visual C++ 8.0
(a.k.a. Visual Studio 2005). There are two Platforms defined, Win32
and x64.
(For other Windows platforms and compilers, see ../PC/readme.txt.)
"

Although I take your point about sharing resources. I'm not sure I should
bother compiling 2.6, since I'll probably come across/already use modules
that I need that don't support 2.6 since it's so new. So it would be nice
to know why following the instructions doesn't work. Compilers never work
for me, though.. even when I follow instructions and they work for everybody
else. It's like a schroedinbug - I just don't expect them to work. As a
matter of principle, though, it /should/ work.. so it's gotta be
*somebody's* job to debug this! :p
 
M

Martin v. Löwis

VS2005 seems to be officially supported.

That impression is incorrect. There is the PCbuild8 directory, but
it isn't maintained or tested in a systematic way. Users of it may
need to adjust it before it can do something useful.

Regards,
Martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top