Skip to content

windows10 cannot load library #154

Open
@Smawexi

Description

@Smawexi

There is a corresponding DLL file in the directory, but the corresponding file cannot be found

import cffi
ffi = cffi.FFI()
lib = ffi.dlopen("D:/Work/produce/HuiHua25/tests/libapi.dll")

Execution error, output:

Traceback (most recent call last):
  File "D:\Work\produce\HuiHua25\tests\test.py", line 38, in <module>
    lib = ffi.dlopen("D:/Work/produce/HuiHua25/tests/libapi.dll")
  File "D:\fsy\Anaconda3\lib\site-packages\cffi\api.py", line 150, in dlopen
    lib, function_cache = _make_ffi_library(self, name, flags)
  File "D:\fsy\Anaconda3\lib\site-packages\cffi\api.py", line 834, in _make_ffi_library
    backendlib = _load_backend_lib(backend, libname, flags)
  File "D:\fsy\Anaconda3\lib\site-packages\cffi\api.py", line 830, in _load_backend_lib
    return backend.load_library(path, flags)
OSError: cannot load library 'D:/Work/produce/HuiHua25/tests/libapi.dll': error 0x7e

D:\Work\produce\HuiHua25\tests>dir
 驱动器 D 中的卷是 Data
 卷的序列号是 7E57-7B60

 D:\Work\produce\HuiHua25\tests 的目录

2025/01/13  00:46    <DIR>          .
2025/01/13  00:46    <DIR>          ..
2025/01/13  00:00    <DIR>          build
2025/01/13  00:00           326,301 key.c
2025/01/13  00:00            52,224 key.cp39-win_amd64.pyd
2025/01/13  00:29             4,017 key.pyx
2025/01/12  20:56         7,833,177 libapi.dll

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions