help compiling Python on vs 2008!

Discussion in 'Python' started by inhahe, May 17, 2008.

  1. inhahe

    inhahe Guest

    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?
     
    inhahe, May 17, 2008
    #1
    1. Advertising

  2. inhahe schrieb:
    > 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
     
    Christian Heimes, May 17, 2008
    #2
    1. Advertising

  3. inhahe

    inhahe Guest

    "Christian Heimes" <> wrote in message
    news:...
    > inhahe schrieb:
    >> 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 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
    reposts here.
     
    inhahe, May 17, 2008
    #3
  4. Matthieu Brucher schrieb:
    > 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
     
    Christian Heimes, May 17, 2008
    #4
  5. Matthieu Brucher schrieb:
    > 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
     
    Christian Heimes, May 17, 2008
    #5
  6. inhahe wrote:
    > "Christian Heimes" <> wrote in message
    > news:...
    >> inhahe schrieb:
    >>> 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 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
    > 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.
     
    Colin J. Williams, May 18, 2008
    #6
  7. inhahe

    inhahe Guest

    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

    "Christian Heimes" <> wrote in message
    news:...
    > Matthieu Brucher schrieb:
    >> 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
    >
     
    inhahe, May 18, 2008
    #7
  8. > 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
     
    Martin v. Löwis, May 18, 2008
    #8
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. alf
    Replies:
    6
    Views:
    383
  2. shapper

    Windows 2008 and SQL 2008

    shapper, Dec 8, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    370
    Mark Fitzpatrick
    Dec 8, 2007
  3. Colin J. Williams

    Compiling Python using Microsoft Visual C++ 2008

    Colin J. Williams, May 12, 2008, in forum: Python
    Replies:
    4
    Views:
    399
    Martin v. Löwis
    May 12, 2008
  4. Juan Pablo Romero Méndez

    Compiling and installing python 2.5.2 with Visual C++ 2008

    Juan Pablo Romero Méndez, Dec 9, 2008, in forum: Python
    Replies:
    0
    Views:
    233
    Juan Pablo Romero Méndez
    Dec 9, 2008
  5. Juan Pablo Romero Méndez
    Replies:
    2
    Views:
    280
    Juan Pablo Romero Méndez
    Dec 11, 2008
Loading...

Share This Page