Accessing shared library file...

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

    #1

    Accessing shared library file...

    I'm in the process of moving a Python application from Windows to
    Linux. This means that the drivers for windows ".dll" now must be
    Linux drivers "shared library file" (.so I think). With Windows, I
    used:

    ctypes ("from ctypes import windll")

    Then "_dll = windll.NAME"

    I'm not sure how to include this new Linux library. Any suggestions?
    Thanks!

  • Larry Bates

    #2
    Re: Accessing shared library file...

    You need to tell us what library file (.dll) are you
    accessing on Windows. The interface to whatever the
    ..dll is used for will most likely be completely
    different on Linux.

    -Larry Bates

    Ernesto wrote:[color=blue]
    > I'm in the process of moving a Python application from Windows to
    > Linux. This means that the drivers for windows ".dll" now must be
    > Linux drivers "shared library file" (.so I think). With Windows, I
    > used:
    >
    > ctypes ("from ctypes import windll")
    >
    > Then "_dll = windll.NAME"
    >
    > I'm not sure how to include this new Linux library. Any suggestions?
    > Thanks!
    >[/color]

    Comment

    • Ernesto

      #3
      Re: Accessing shared library file...

      The .dll file is a shared library file that is associated with a
      programming interface for a semi-conductor chip. The chip drivers come
      in two different flavors: One is a .dll (for Windows) and the other is
      a shared library file for Linux. The name of the Linux file is
      "nameofFile.so. 0.4.5" The company that makes these drivers (FTDI) says
      that the API's for both OS's are practically the same (except you
      obviously cannot use WIN32 functions when running on Linux). I wish I
      knew more about Linux drivers...

      Comment

      • Peter Hansen

        #4
        Re: Accessing shared library file...

        Ernesto wrote:[color=blue]
        > The .dll file is a shared library file that is associated with a
        > programming interface for a semi-conductor chip. The chip drivers come
        > in two different flavors: One is a .dll (for Windows) and the other is
        > a shared library file for Linux. The name of the Linux file is
        > "nameofFile.so. 0.4.5" The company that makes these drivers (FTDI) says
        > that the API's for both OS's are practically the same (except you
        > obviously cannot use WIN32 functions when running on Linux). I wish I
        > knew more about Linux drivers...[/color]

        I believe Larry misinterpreted the question, thinking you were asking
        about how to call routines in the library, not just how to load the
        library itself. I don't know the answer either, but I can at least
        suggest that asking in the ctypes mailing list is pretty much certain to
        get you a quick, correct answer (assuming no one gives one here).

        -Peter

        Comment

        • Ernesto

          #5
          Re: Accessing shared library file...

          Where is the ctypes mailing list?

          Comment

          • Thomas Jollans

            #6
            Re: Accessing shared library file...

            Ernesto wrote:[color=blue]
            > The .dll file is a shared library file that is associated with a
            > programming interface for a semi-conductor chip. The chip drivers come
            > in two different flavors: One is a .dll (for Windows) and the other is
            > a shared library file for Linux. The name of the Linux file is
            > "nameofFile.so. 0.4.5" The company that makes these drivers (FTDI) says
            > that the API's for both OS's are practically the same (except you
            > obviously cannot use WIN32 functions when running on Linux). I wish I
            > knew more about Linux drivers...
            >[/color]

            on linux, usually *all* library files are stored in dedicated
            directories like /lib /usr/lib or /usr/local/lib you can then acces the
            lib just by 'nameofFile'. example: if you have
            '/usr/lib/libqt-mt.so.3.3.4' installed, you only need to tell the
            compiler to use the library 'qt-mt'. You can create a seperate lib
            directory for your project, but you probably need to set some
            environment variables for that. I believe pyrex is your friend when
            dealing with C libraries in python.

            Comment

            • Peter Hansen

              #7
              Re: Accessing shared library file...

              Ernesto wrote:[color=blue]
              > Where is the ctypes mailing list?[/color]

              GIYF (Google is your friend)

              Comment

              Working...