-
Notifications
You must be signed in to change notification settings - Fork 36
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
Failed to load dynamic library on Windows 10 when running an example 0.0.7 #22
Comments
Could you check the instructions at #7? In short, flutter_serial_port ships the required external library. |
Hi @jpnurmi , Thanks for your response. Are you suggesting that on Windows there is no way to use the serialport using purely dart? |
@pouryaomidi It's certainly possible to use [*] Simply because Flutter provides a build system to do that, whereas pure Dart packages don't have a way to build native C code. |
@jpnurmi, I've already built libserialport using Visual Studio, then added the library in my path, but I still face the same issue mentioned above. Should I mention the libserialport.dll anywhere in the yaml file? |
Where is the DLL placed? If I remember correctly, in Windows the DLL can be found "out of the box" if it's in the same directory with the application executable. If that's not possible, you can also define the |
I have tried to put it in dart/bin and next to the example file and both results in failed to load error. I will try the last option you said and send an update. |
After creating a system environment variable |
Give me built tutorial of libserialport |
@blackghost1379, you can get the compiled library "libserialport-0.dll" here: |
Hi, Running the example given on https://pub.dev/packages/dart_serial_port/example gives me the following error:
Invalid argument(s): Failed to load dynamic library (126)
#0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:55)
#1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:20:12)
#2 LibraryLoader.load (package:dart_serial_port/src/dylib.dart:78:58)
#3 dylib (package:dart_serial_port/src/dylib.dart:31:67)
#4 _SerialPortImpl.availablePorts. (package:dart_serial_port/src/port.dart:230:32)
#5 Util.call (package:dart_serial_port/src/util.dart:37:21)
#6 _SerialPortImpl.availablePorts (package:dart_serial_port/src/port.dart:230:21)
#7 SerialPort.availablePorts (package:dart_serial_port/src/port.dart:82:61)
#8 main (file:///D:/Projects/playground/untitled/bin/untitled.dart:14:33)
#9 _delayEntrypointInvocation. (dart:isolate-patch/isolate_patch.dart:283:19)
#10 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
I am using dart sdk version: 2.12.0-259.8.beta (beta) (Tue Feb 2 15:59:29 2021 +0100) on "windows_x64".
Any tip is appreciated!
Pourya
The text was updated successfully, but these errors were encountered: