python and visual C++

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

    #1

    python and visual C++

    Hi,

    When I tryed to compile a python module using distutils under windows,
    and there is an error message if we do not have Microsoft Visual C++ 6
    installed.
    This is because python have been compiled with MSVC6 and distutils wants it
    in order to compile C++ python modules.

    One of the reasons why I use python is because this is a free language. But
    I need
    a non free compilator to compile my C++ module !!! Choosing MSVC to compile
    python is a strange choice since there are other free compilators like
    MinGW.

    I think that using another compilator should be possible in order to compile
    python
    modules since I use BOOST/MinGW to develop my own modules...

    Diffrerent solutions appears :
    - peoples who compile python for windows should use a free compilator
    (MinGW or Microsoft Visual C++ Toolkit 2003 for example)
    - modify distutils in order to use another compilator

    Is there anyone that have experienced this "free" problem and is there a
    solution
    that I did not note. I don't want to buy MSVC...

    Thanks

    O.R.



  • Robin Becker

    #2
    Re: python and visual C++

    Olivier Ravard wrote:
    ........ use another compilator[color=blue]
    >
    > Is there anyone that have experienced this "free" problem and is there a
    > solution
    > that I did not note. I don't want to buy MSVC...
    >
    > Thanks
    >
    > O.R.
    >
    >
    >[/color]
    Googled mingw lib for python brings me to



    which may help

    --
    Robin Becker

    Comment

    • Caleb Hattingh

      #3
      Re: python and visual C++

      Olivier

      If you consider using the ctypes module, you can write a dll (windows) or
      a shared object (linux) using anything that can make one of those.

      For example, I have successfully used FreePascal to make a dynamic library
      on both windows and linux and use that library within python on both
      platforms.

      Heck, even the objectpascal code for the dll was unchanged on both
      platforms. I simply needed to recompile the objectpascal file on each
      using FreePascal. Also FreePascal is available on many more platforms
      (though not quite as many as python, I'll wager).

      This is the only way I ever intend making native binary additions to my
      own programs.

      Regards
      Caleb


      On Wed, 2 Feb 2005 12:35:08 +0100, Olivier Ravard
      <olivier.ravard @novagrid.com> wrote:
      [color=blue]
      > Hi,
      >
      > When I tryed to compile a python module using distutils under windows,
      > and there is an error message if we do not have Microsoft Visual C++ 6
      > installed.
      > This is because python have been compiled with MSVC6 and distutils wants
      > it
      > in order to compile C++ python modules.
      >
      > One of the reasons why I use python is because this is a free language.
      > But
      > I need
      > a non free compilator to compile my C++ module !!! Choosing MSVC to
      > compile
      > python is a strange choice since there are other free compilators like
      > MinGW.
      >
      > I think that using another compilator should be possible in order to
      > compile
      > python
      > modules since I use BOOST/MinGW to develop my own modules...
      >
      > Diffrerent solutions appears :
      > - peoples who compile python for windows should use a free compilator
      > (MinGW or Microsoft Visual C++ Toolkit 2003 for example)
      > - modify distutils in order to use another compilator
      >
      > Is there anyone that have experienced this "free" problem and is there a
      > solution
      > that I did not note. I don't want to buy MSVC...
      >
      > Thanks
      >
      > O.R.
      >
      >
      >[/color]

      Comment

      • Olivier Ravard

        #4
        Re: python and visual C++


        "Caleb Hattingh" <caleb1@telkoms a.net> a écrit dans le message de news:
        opsllp87k61js0x s@news.telkomsa .net...[color=blue]
        > Olivier
        >
        > If you consider using the ctypes module, you can write a dll (windows) or
        > a shared object (linux) using anything that can make one of those.
        >
        > For example, I have successfully used FreePascal to make a dynamic library
        > on both windows and linux and use that library within python on both
        > platforms.[/color]

        Yes. I do this too. I make my own modules with C++/BOOST and compile them
        with gcc under Linux and Windows.

        But the problem is about modules thats are developped from others with
        distutils...

        [color=blue]
        >
        > Heck, even the objectpascal code for the dll was unchanged on both
        > platforms. I simply needed to recompile the objectpascal file on each
        > using FreePascal. Also FreePascal is available on many more platforms
        > (though not quite as many as python, I'll wager).[/color]
        [color=blue]
        >
        > This is the only way I ever intend making native binary additions to my
        > own programs.
        >
        > Regards
        > Caleb
        >
        >
        > On Wed, 2 Feb 2005 12:35:08 +0100, Olivier Ravard
        > <olivier.ravard @novagrid.com> wrote:
        >[color=green]
        > > Hi,
        > >
        > > When I tryed to compile a python module using distutils under windows,
        > > and there is an error message if we do not have Microsoft Visual C++ 6
        > > installed.
        > > This is because python have been compiled with MSVC6 and distutils wants
        > > it
        > > in order to compile C++ python modules.
        > >
        > > One of the reasons why I use python is because this is a free language.
        > > But
        > > I need
        > > a non free compilator to compile my C++ module !!! Choosing MSVC to
        > > compile
        > > python is a strange choice since there are other free compilators like
        > > MinGW.
        > >
        > > I think that using another compilator should be possible in order to
        > > compile
        > > python
        > > modules since I use BOOST/MinGW to develop my own modules...
        > >
        > > Diffrerent solutions appears :
        > > - peoples who compile python for windows should use a free[/color][/color]
        compilator[color=blue][color=green]
        > > (MinGW or Microsoft Visual C++ Toolkit 2003 for example)
        > > - modify distutils in order to use another compilator
        > >
        > > Is there anyone that have experienced this "free" problem and is there a
        > > solution
        > > that I did not note. I don't want to buy MSVC...
        > >
        > > Thanks
        > >
        > > O.R.
        > >
        > >
        > >[/color]
        >[/color]


        Comment

        Working...