#๐Ÿ”’ Compile CFFI C_Code

4 messages ยท Page 1 of 1 (latest)

violet arrow
#

Alright I have been walking around in circles for idk a week (2?) at this point and I am painfully close to maybe having something working.

TLDR; I am attempting to use CFFI to create an API of some c code. I can't get ffibuilder.compile() to work on my windows machine, so I am trying to build it from source (using the .emit_c_code) After many days of trying to figure this out and help from someone in the zig discord (long story; don't ask) I have managed to compile the emitted c code into a .dll file and now I don't know how to import it and actually use it in python. Also while it may well be faster to figure out why ffibuilder.compile() hates me personally I am sort of committed at this point (and am also very curious as to how to actually compile it manually; it irritates me that I cannot figure it out).

(EDIT : Also for a specific error when I run from my_lib import ffi, lib it says that there is no module called my_lib also my_lib.dll and my python file are in the same directory. Just thought I should clarify)

I would also like to eventually be able to release this as a module other people can import and I also don't really know where/how to do that (beyond that it has something to do with setuptools and python virtual environments or something.) BUT that is not immediately relevant if I cannot access the python code.

cold bisonBOT
#

@violet arrow

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

cold bisonBOT
#

@violet arrow

Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.