作者热门文章
- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试使用 MinGW 在 Windows 上使用 wx-widgets 和 scons。这是我的 SConstruct 的违规行:
env.ParseConfig("wx-config --cxxflags --libs")
紧接着,打印 env['CPPPATH'] 给出:
['C:software_libwxWidgets2.8libgcc_dllmsw', 'C:software_libwxWidgets2.8include']
显然,它似乎缺少一些非常重要的斜杠。我认为这可能与 wx-config 的 windows 端口在其输出中给出反斜杠有关。
这些路径稍后会逐字传递给编译器,从而导致错误。其他一切都很好。
我该怎么做才能解决这个问题?
最佳答案
用蛮力解决了问题。编写了一个由以下内容组成的帮助程序 python 脚本:
import subprocess, sys
p = subprocess.Popen(["wx-config", "--cxxflags", "--libs"], stdout=subprocess.PIPE)
out, err = p.communicate()
san = out.replace("\\", "/")
sys.stdout.write(san)
sys.exit(0)
最后打电话
env.ParseConfig("python sanitize-wx-config.py")
在 SConscript 文件中。这解决了问题:
关于c++ - scons ParseConfig 在 Windows 上使用 wx-config 时行为不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13783151/
我正在尝试使用 MinGW 在 Windows 上使用 wx-widgets 和 scons。这是我的 SConstruct 的违规行: env.ParseConfig("wx-config --cx
我是一名优秀的程序员,十分优秀!