jdf / Processing.py-Bugs

A home for all bugs and feature requests about Python Mode for the Processing Development Environment.
41 stars 8 forks source link

Serial library can not be used on a Windows 64bit with Python #227

Closed tikonen closed 4 years ago

tikonen commented 6 years ago

It looks like processing is using incorrect dll search path on a 64bit architecture.

Following code fails.

add_library('serial')

from java.lang import System
System.loadLibrary("jSSC-2.8") #the native library we need

def setup():
    print Serial.list()

with an error

processing.app.SketchException: java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\processing-3.3.7\modes\java\libraries\serial\library\windows32\jSSC-2.8.dll: Can't load IA 32-bit .dll on a AMD 64-bit platform
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1857)

However if I delete the 32-bit DLL the code works. C:\Program Files (x86)\processing-3.3.7\modes\java\libraries\serial\library\windows32\jSSC-2.8.dll

Output is as expected array(java.lang.String, [u'COM1', u'COM8'])

kschoenborn commented 6 years ago

Hi tikonen, Confirmed. I had the same issue on a Win10 64bit Laptop. Deleting windows32\jSSC-2.8.dll works perfectly. Thanks.

villares commented 4 years ago

Hi @REAS, sorry to take your time, but who do you think might know how to tackle this?

REAS commented 4 years ago

@villares I don't know, sorry. @jdf is the source here in Python land. I might guess this issue would be a great candidate for a pull request.

villares commented 4 years ago

@jdf I think you can close this one too! :)