scons ParseConfig 在 Windows 上使用 wx-config 的行为不正确
scons ParseConfig behaving incorrectly with wx-config on windows
我正在尝试使用MinGW在Windows上使用带有scons的wx-widgets。这是我的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 文件中。这解决了问题:
相关文章:
- 使用2个键的cpp-stl::优先级队列排序不正确
- 正弦级数方程计算不正确
- 我试图制作一个程序,要求用户输入问题和答案,但程序循环不正确
- 密码登录程序将永远循环并显示不正确的结果
- 在C++中返回不正确的楼层函数值
- 形状对象的旋转和缩放不正确C++
- C++ 读取文件读取文件不正确
- 关于类的 Python 文档 - 对C++的引用不正确
- 特征 LLT 模块给出不正确的结果?
- glibcxx STL 在实现 std::valarray::sum() 时是否不正确?
- 如果语句逻辑不正确
- 来自逆 vp 矩阵和相机位置的光线方向不正确
- 不正确的操作数类型 MSVC
- 数组填充了不正确的值
- 我是否不正确地集中了这些字符数组?
- 为什么除非我使用 cout,否则我的值不正确?
- 计算幂级数的数学结果不正确
- 为什么 sizeof 在 C++ 中给出不正确的字节数?
- atoi() 在应用于大型命令行参数时会产生不正确的值
- scons ParseConfig 在 Windows 上使用 wx-config 的行为不正确