Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    using Cython

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 440 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 13/08/2011 at 04:25, xxxxxxxx wrote:

      Hi,

      I want to write a module for c4d using Cython, but importing the compiled module fails with "DLL %1 is not a valid win32 executable" when using with Cinema 4d 64 Bit.

      I created a libpython26.a using dlltool and my gcc-command looks like this:

      gcc __init__.pyx -shared -o test_a.pyd -I"C:\Program Files\MAXON\Cinema 4D\resource\modules\python\res\Python.Win64.framework\include" -L"C:\Program Files\MAXON\Cinema 4D\resource\modules\python\res\Python.Win64.framework\libs" -lpython26

      Am i missing something ?

      Thanks,

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 13/08/2011 at 10:49, xxxxxxxx wrote:

        Hey Nux,

        I am not really sure, but I guess it is like this:

        If you compile for Cython, you can only run it with Cython. If you compile a dll, you will be able to use it within python.

        http://sig9.com/node/35
        http://www.perrygeo.net/wordpress/?p=116

        http://stackoverflow.com/questions/252417/how-can-i-use-a-dll-from-python
        http://docs.python.org/library/ctypes.html

        Cheers,
        maxx

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 14/08/2011 at 09:51, xxxxxxxx wrote:

          Here is another enlightenment I had:

          >>Is a *.pyd file the same as a DLL?

          >>Yes, .pyd files are dll's, but there are a few differences. If you have a DLL named foo.pyd, then it must
          >>have a function initfoo(). You can then write Python "import foo", and Python will search for foo.pyd
          >>(as well as foo.py, foo.pyc) and if it finds it, will attempt to call initfoo() to initialize it. You do not link
          >>your .exe with foo.lib, as that would cause Windows to require the DLL to be present.

          Cheers,
          maxx

          1 Reply Last reply Reply Quote 0
          • First post
            Last post