作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
>> import subprocess >>> p = -6ren">
我正在构建一个 Python 脚本来自动化我的构建过程,该脚本使用 subprocess.Popen 调用 GCC。我最初的尝试效果很好。
>>> import subprocess
>>> p = Popen(['gcc', 'hello.c'], stdout=subprocess.PIPE, stderr=stderr=subprocess.STDOUT)
>>> p.wait()
0
>>> p.communicate()
('', None)
但是,一旦我将其他选项传递给 GCC,我就会收到错误“无输入文件”,如下所示:
>>> import subprocess
>>> p = Popen(['gcc', '-o hello hello.c'], stdout=subprocess.PIPE, stderr=stderr=subprocess.STDOUT)
>>> p.wait()
1
>>> p.communicate()
('gcc: no input files\r\n', None)
有什么想法可能导致此问题吗?
最佳答案
难道不是
p = Popen(['gcc', '-o', 'hello', 'hello.c'], stdout=subprocess.PIPE, stderr=stderr=subprocess.STDOUT)
关于Python subprocess.Popen - 添加 GCcflags导致 "no input files"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1448558/
在流程的链接部分,是否存在 -ansi、-Wall 和 -pedantic 等标志可能相关的情况? -O 优化标志怎么样?它们仅在编译步骤期间相关,还是在链接期间也相关? 谢谢! 最佳答案 在实践中,
我正在编写一个简单的 C 程序,我应该用缓冲区溢出来攻击它。所以,我不想在编译时使用任何标志。如何消除使用的默认标志? # readelf -p .GCC.command.line stack Str
我正在尝试在 powerpc arch 上运行 Rust 程序。当我在 C 中构建我的代码时,我使用标志 -mlongcall。 我如何为我的 Rust 程序使用这个标志?一般来说,如果我能在我的 R
我真的需要一些基本问题的帮助。我即将永远放弃学习 GCC,因为基础知识对我来说似乎没有意义。我已经阅读了数百篇文章,但无法弄清楚如何通过 configure 获得基本的 -std=c++11 工作调用
我是一名优秀的程序员,十分优秀!