Я пытаюсь автоматически сгенерировать входные аргументы и вернуть тип, используя ctypesgen для кода C ++ в windows os.
Я попробовал несколько способов, посмотрев на несколько примеров. Как это указано в вики
python ctypesgen.py -lneon C:\Users\Desktop\sdk\include\U_wrapper\U_Wrapper.h -o C:\Users\Desktop\Newfolder\ctypesgen-ctypesgen-0.1.0\ctypesgen-ctypesgen-0.1.0\test.py
Ниже приведена ошибка
INFO: Status: Preprocessing C:\Users\AppData\Local\Temp\tmpum3wmfiz.h
INFO: Status: cl -E -U __GNUC__ -dD "-Dinline=" "-D__inline__=" "-D__extension__=" "-D__const=const" "-D__asm__(x)=" "-D__asm(x)=" "-DCTYPESGEN=1" "C:\Users\AppData\Local\Temp\tmpum3wmfiz.h"
ERROR: cl -E: Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27034 for x64
ERROR: cl -E: Copyright (C) Microsoft Corporation. All rights reserved.
ERROR: cl -E: cl : Command line warning D9002 : ignoring unknown option '-dD'
ERROR: cl -E: tmpum3wmfiz.h
ERROR: cl -E: C:\Users\Desktop\sdk\include\U_wrapper\U_Wrapper.h(12): fatal error C1034: iostream: no include path set
INFO: Status: Parsing C:\Users\AppData\Local\Temp\tmpum3wmfiz.h
INFO: Status: Processing description list.
INFO: Status: Writing to C:\Users\Desktop\Newfolder\ctypesgen-ctypesgen-0.1.0\ctypesgen-ctypesgen-0.1.0\test.py.
Traceback (most recent call last):
File "ctypesgen.py", line 179, in <module>
if __name__ == "__main__":
File "ctypesgen.py", line 166, in main
# Step 3: Print
File "C:\Users\Desktop\Newfolder\ctypesgen-ctypesgen-0.1.0\ctypesgen-ctypesgen-0.1.0\ctypesgencore\printer_python\printer.py", line 51, in __init__
self.print_preamble()
File "C:\Users\Desktop\Newfolder\ctypesgen-ctypesgen-0.1.0\ctypesgen-ctypesgen-0.1.0\ctypesgencore\printer_python\printer.py", line 147, in print_preamble
path, v = get_preamble(**m.groupdict())
File "C:\Users\Desktop\Newfolder\ctypesgen-ctypesgen-0.1.0\ctypesgen-ctypesgen-0.1.0\ctypesgencore\printer_python\printer.py", line 31, in get_preamble
v = L[0]
IndexError: list index out of range
2-й способ
python ctypesgen.py -I C:\Users\Desktop\sdk\include\U_wrapper\U_Wrapper.h -o C:\Users\Desktop\Newfolder\ctypesgen-ctypesgen-0.1.0\ctypesgen-ctypesgen-0.1.0\test.py
Я вижу эту ошибку
ERROR: No header files specified
3-й способ:
python ctypesgen.py --cpp C:\Users\Desktop\sdk\include\U_wrapper\U_Wrapper.cpp -o C:\Users\Desktop\Newfolder\ctypesgen-ctypesgen-0.1.0\ctypesgen-ctypesgen-0.1.0\test.py
Я вижу эту ошибку
ERROR: No header files specified
, пожалуйста, помогите по этому поводу.