compiling modules with VS 2008 for python 2.4 prepared with VisualStudio 2003

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • alf

    #1

    compiling modules with VS 2008 for python 2.4 prepared with VisualStudio 2003

    Hi,

    I want to add some library but it can not be comipled? Here is an output:


    D:\>cl
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42
    for 80x86
    Copyright (C) Microsoft Corporation. All rights reserved.

    usage: cl [ option... ] filename... [ /link linkoption... ]


    D:\python setup.py install
    running install
    running build
    running build_ext
    error: Python was built with Visual Studio 2003;
    extensions must be built with a compiler than can generate compatible
    binaries.
    Visual Studio 2003 was not found on this system. If you have Cygwin
    installed,
    you can try compiling with MingW32, by passing "-c mingw32" to setup.py.



    Thx for the help, Andy
  • Alex Martelli

    #2
    Re: compiling modules with VS 2008 for python 2.4 prepared with Visual Studio 2003

    alf <ask@mewrote:
    Hi,
    >
    I want to add some library but it can not be comipled? Here is an output:
    If you don't have the needed compiler installed (in this case, VS 2003,
    while it looks like your installation has VS 2005 instead), sure.

    D:\>cl
    Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.42
    for 80x86
    Copyright (C) Microsoft Corporation. All rights reserved.
    >
    usage: cl [ option... ] filename... [ /link linkoption... ]
    >
    >
    D:\python setup.py install
    running install
    running build
    running build_ext
    error: Python was built with Visual Studio 2003;
    extensions must be built with a compiler than can generate compatible
    binaries.
    Visual Studio 2003 was not found on this system. If you have Cygwin
    installed,
    you can try compiling with MingW32, by passing "-c mingw32" to setup.py.
    I would think this error message is as clear as it can be, and then
    some! It even gives very practical advice on how to work around the
    problem. Either install VS2003, if you own it or can purchase it, or
    else install mingw32 (which is free and can be downloaded) and use the
    option which the error message tells you to.


    Alex

    Comment

    • alf

      #3
      Re: compiling modules with VS 2008 for python 2.4 prepared with VisualStudio 2003

      Alex Martelli wrote:
      I would think this error message is as clear as it can be, and then
      some! It even gives very practical advice on how to work around the
      problem. Either install VS2003, if you own it or can purchase it, or
      else install mingw32 (which is free and can be downloaded) and use the
      option which the error message tells you to.
      >
      well, instructions were clear enough for me. What is hard to get why it
      could not use free M$ compiler which is presumably produces compatible
      objects and libraries.

      In fact I played with msvccompiler.py a little bit, get around registry
      paths and was able to produce .pyo file. Then I hit some runtime lib
      issues. In meantime I found precompiled probstat lib so gave up on
      making msvccompiler.py compatible with VS 2008.

      Bottomline - it would be nice to have such support.
      --
      alf

      Comment

      • =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

        #4
        Re: compiling modules with VS 2008 for python 2.4 prepared with VisualStudio 2003

        well, instructions were clear enough for me. What is hard to get why it
        could not use free M$ compiler which is presumably produces compatible
        objects and libraries.
        This presumption is incorrect. The compiler does *not* create compatible
        objects and libraries. It links with msvcr8.dll, whereas Python is
        linked with mscvr71.dll; Microsoft does not support mixing CRTs.

        Regards,
        Martin

        Comment

        • alf

          #5
          Re: compiling modules with VS 2008 for python 2.4 prepared with VisualStudio 2003

          Martin v. Löwis wrote:
          >>well, instructions were clear enough for me. What is hard to get why it
          >>could not use free M$ compiler which is presumably produces compatible
          >>objects and libraries.
          >
          >
          This presumption is incorrect. The compiler does *not* create compatible
          objects and libraries. It links with msvcr8.dll, whereas Python is
          linked with mscvr71.dll; Microsoft does not support mixing CRTs.
          >
          complier is just a compiler. perhaps final linking could be somehow
          tweaked to include msvcrt71 instad of 80.

          Comment

          • =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

            #6
            Re: compiling modules with VS 2008 for python 2.4 prepared with VisualStudio 2003

            complier is just a compiler. perhaps final linking could be somehow
            tweaked to include msvcrt71 instad of 80.
            Not easily. VS 2005 is not just a complier, it is also a rinkel,
            and ships with improt librareis. The import library for msvcrt.lib
            it ships with automatically links with msvcr8.dll.

            You either would have to create a import library for mscvr71.dll
            by hand, or you have to copy one from VS 2003 (breaking its license).

            Regards,
            Martin

            P.S. Why does the subject say "VS 2008", anyway? That product has
            not been released yet, and Microsoft is still hoping that it will
            be called VS 2007.

            Comment

            • alf

              #7
              Re: compiling modules with VS 2008 for python 2.4 prepared with VisualStudio 2003

              Martin v. Löwis wrote:

              You either would have to create a import library for mscvr71.dll
              by hand, or you have to copy one from VS 2003 (breaking its license).

              I wonder if copying the probstat.pyd from internet where I it finnaly
              found is not breaking the license:-). it was my final solution.
              otherwise I would probaly it somehow link. I hardly give up.

              P.S. Why does the subject say "VS 2008", anyway? That product has
              not been released yet, and Microsoft is still hoping that it will
              be called VS 2007.
              just a mistake. i am not Microsoft fan. Just happened that python app I
              develop is executed on win32.

              thx for all insight

              Comment

              Working...