Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python windows #7

Open
antoinedewailly opened this issue Dec 14, 2016 · 2 comments
Open

Python windows #7

antoinedewailly opened this issue Dec 14, 2016 · 2 comments
Assignees

Comments

@antoinedewailly
Copy link

I use your project heatmap with python and linux thanks to the .so library but now I would like to do the same with python and windows.
How I could have a .dll ?

@lucasb-eyer
Copy link
Owner

Sorry Antoine, I wanted to get to it this week-end, but unfortunately didn't. I'll get back to it ASAP though.

What needs to be done (for VisualC++) is essentially sprinkle the header and code with optional __declspec(dllimport) and/or __declspec(dllexport), like I've done here. I will do that in the provided msvc project files, and additionally, I'll include a pre-compiled .dll in the repo for convenience.

@lucasb-eyer lucasb-eyer self-assigned this Dec 19, 2016
@lucasb-eyer
Copy link
Owner

Hi again, Antoine. I have successfully created a 64-bit DLL and got it to work within (64-bit) Python on Windows. I've pushed the code-changes, VS-2017 project files and a pre-compiled DLL to the win-dll branch.

Note that it will not work with the code from the README as-is, because apparently things are more finnicky on windows. In Python, you need to declare the function return types and parameter types as described in the ctypes doc here, otherwise it will crash.

I plan to update that in the README file too before I merge to master, but since it may take me a little time (with Christmas and all), I pushed the preliminary changes to that branch so you could use them right away.

In the long term, it's probably better to create a wrapper in Cython as a separate project though, I just won't get to that myself anytime soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants