尝试运行Nuitka时出现PyTime'struct timeval'错误消息

时间:2019-12-02 18:09:16

标签: python c compiler-errors compilation nuitka

Nuitka版本::Nuitka-0.6.6rc7(与Nuitka-0.6.5相同)

Python版本: 3.8

平台: Windows 10

存档: x86

安装方法:同时使用pip和网站上的.zip存档。 (打开包装并运行python setup.py install

我已经在包含以下代码的极其基本的文件上测试了Nuitka:

text = "Hello World!"

def hello():
    return print(text)

hello()

在此文件上运行nuitka --standalone test.py时,我收到了奇怪的错误消息:

In file included from C:\Users\igors\AppData\Local\Programs\Python\Python38-32\include/Python.h:85,
                 from test.build\__frozen.c:3:
C:\Users\igors\AppData\Local\Programs\Python\Python38-32\include/pytime.h:123:59: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
 PyAPI_FUNC(int) _PyTime_FromTimeval(_PyTime_t *tp, struct timeval *tv);
                                                           ^~~~~~~
C:\Users\igors\AppData\Local\Programs\Python\Python38-32\include/pytime.h:130:12: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
     struct timeval *tv,
            ^~~~~~~
C:\Users\igors\AppData\Local\Programs\Python\Python38-32\include/pytime.h:135:12: warning: 'struct timeval' declared inside parameter list will not be visible outside of this definition or declaration
     struct timeval *tv,
            ^~~~~~~

这些错误反复出现,之后Nuitka退出并显示以下消息:

c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: test.build/MainProgram.o:MainProgram.c:(.text.startup+0x7b): undefined reference to `SetDllDirectoryW'
collect2.exe: error: ld returned 1 exit status
scons: *** [test.dist\test.exe] Error 1

我以前从未使用过Nuitka,目前却不知道可能会导致这种行为,但是无论它是什么意思,它似乎都可以与PyTimestruct timeval相关。

UPD::将C:\MinGW\bin包含在PATH中之后,我收到了另一条错误消息:

c:/mingw/bin/../lib/gcc/mingw32/8.2.0/../../../../mingw32/bin/ld.exe: test.build/MainProgram.o:MainProgram.c:(.text.startup+0x7b): undefined reference to `SetDllDirectoryW'
collect2.exe: error: ld returned 1 exit status
scons: *** [test.dist\test.exe] Error 1

我认为这是一个进步,但是,它仍然退出错误1的代码。虽然不确定SetDllDirectoryW的含义。有什么想法吗?

0 个答案:

没有答案