openfoam: flex yyin.rdbuf(std::cin.rdbuf() error
openfoam: flex yyin.rdbuf(std::cin.rdbuf() error
我想报告错误I的解决方案在Mac OS X El Capitan版本10.11.2中安装OpenFOAM 3.0.1时获得错误是:
"错误:成员引用类型"std::istream*"(又名"basic_istream*")是指针;也许你是想用"->"?yyin.rdbuf(std::cin.rdbuff());"
这个问题与flex version 2.6.0
有关。我使用macports安装的。
我可以通过使用位于/usr/bin/flex
(而不是/opt/local/flex
)的"flex 2.5.35 Apple(flex-31)
"来克服这个问题。
只需将文件中的"flex"更改为"/usr/bin/flex"$(WM_DIR)/规则/常规/flex++您的openfoam源代码分发。
我认为这可能是一个有点晚的答案,但我认为问题是"FlexLexer.h"不同步。Flex 2.6.0为C++扫描程序更改了yyin存储的存储定义,用于头和生成的源。然而,我认为mac端口包包括一个过时的FlexLexer.h,尽管flex本身已经更新。这会导致您将不匹配视为编译错误。
您可以使用更新的"FlexLexer.h"(例如,下面的版本:https://github.com/westes/flex/blob/master/src/FlexLexer.h)
我刚刚从源代码编译了OpenFOAM v6,并得到了相同的错误,所以这个问题仍然相关。错误出现在wmake surfmesh
中,其中第一个错误类似于
flex -+ ..........
.../OpenFOAM/OpenFOAM- 6/platforms/linux64GccDPInt32Opt/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatASCII.L.C: In member function ‘int STLASCIILexer::lex()’:
.../OpenFOAM/OpenFOAM-6/platforms/linux64GccDPInt32Opt/src/surfMesh/surfaceFormats/stl/STLsurfaceFormatASCII.L.C:5494:9: error: request for member ‘rdbuf’ in ‘((STLASCIILexer*)this)->STLASCIILexer::<anonymous>.yyFlexLexer::yyin’, which is of pointer type ‘std::istream* {aka std::basic_istream<char>*}’ (maybe you meant to use ‘->’ ?)
yyin.rdbuf(std::cin.rdbuf());
将$HOME/OpenFOAM/OpenFOAM-6/wmake/rules/General/flex++
中的flex
更改为/usr/bin/flex
所提供的解决方案对我来说是可行的。
- "error: no matching function for call to"构造函数错误
- C++,OpenCV,尝试显示图像时"OpenCV(4.3.0) Error: Assertion failed (size.width>0 && size.height>0)"此错误
- 使用 LuaBridge 将 LuaJIT 绑定到C++会导致"PANIC: unprotected error"
- OpenMP卸载说'fatal error: could not find accel/nvptx-none/mkoffload'
- C++错误:"error: int aaa::bbb is protected within this context"
- 尝试链接我的着色器时,我收到错误代码"error c5145 must write to gl_position"
- C++,在int数组中输入字符串或字符会输出0,而不是ascii或error
- 使用 cmake 的 LLVM 构建在 tsan_libdispatch_mac.cc 期间失败; "Error: conflicting types for ..."
- C++ "error: invalid use of void expression"
- struct.error:解压缩 C++ 结构时,解包需要 288 字节的缓冲区
- 如何修复"error: ‘_1’ was not declared in this scope"?
- 为什么缓冲区的内容在读取空 rdbuf 时被删除?
- 从不同目录执行时"symbol lookup error:",否则从构建目录执行时按预期工作
- 对象声明中的模板"error: expected expression"
- 在C++中使用 Catch 测试框架编译错误"error: expected ';' at end of declaration list"
- OpenCV 3.4.1 error readNetFromTensorflow 无法在 cv::d nn::ReadProtoFromBinaryFile 中打开 .pb
- 已解决 - C++ 的崇高文本中的"fatal error: opencv: no such file or directory"
- 为什么我会"error: expected expression"?
- CMake Error at modules/videoio/cmake/detect_ffmpeg.cmake:16
- openfoam: flex yyin.rdbuf(std::cin.rdbuf() error