Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python gcc错误输出未定向到文件_Python_Linux_Gcc_Wxpython - Fatal编程技术网

Python gcc错误输出未定向到文件

Python gcc错误输出未定向到文件,python,linux,gcc,wxpython,Python,Linux,Gcc,Wxpython,我很难找出python构建(试图从源代码构建wxPython)中的gcc进程为什么没有输出到日志文件。我像这样执行python构建: python setup.py build>build.log 此安装脚本在其中运行gcc。信息非常丰富,可从屏幕上滚动显示。这就是为什么我把它定向到一个日志文件。不幸的是,没有记录任何超过gcc命令的内容。换句话说,日志文件中的内容如下: Preparing CORE... Preparing STC... [etc lots of other python-r

我很难找出python构建(试图从源代码构建wxPython)中的gcc进程为什么没有输出到日志文件。我像这样执行python构建:

python setup.py build>build.log

此安装脚本在其中运行gcc。信息非常丰富,可从屏幕上滚动显示。这就是为什么我把它定向到一个日志文件。不幸的是,没有记录任何超过gcc命令的内容。换句话说,日志文件中的内容如下:

Preparing CORE...
Preparing STC...
[etc lots of other python-related messages]
gcc -pthread -fno-strict-aliasing... [etc. very long gcc command]

然后什么也没有。原木就停在这里。我知道还有很多,因为当我在终端上运行同一个命令时,我会得到更多的东西,结尾是“gcc失败,退出代码为1”。但是,由于无法看到gcc错误,因为它们会从屏幕上滚动,我不知道问题出在哪里。

gcc
正在写入
stderr
。使用
2>&1>文件将其链接到
stdout


如果只想重定向
stderr
,请使用
2>文件
。有关重定向的更多信息,请查看shell的
man

也将标准错误输出重定向到build.log。 重定向语法取决于您使用的shell

对于普通的
sh
bash

python setup.py build > build.log 2>&1
使用
tcsh

python setup.py build >& build.log

如果我这样做,我会收到几个与Python相关的消息,然后“无效的命令名'build.log'”