【发布时间】:2022-11-30 13:55:18
【问题描述】:
我正在尝试使用 Doxygen 为我的代码创建文档。按照 Doxygen 文档,当我运行 cmake -G "Unix Makefiles" .. 时,编译器告诉我
CMake Error at CMakeLists.txt:112 (message):
Doxygen requires at least bison version 2.7 (installed: 2.3)
但是,当我运行bison -V 时,我看到:
bison (GNU Bison) 3.8.2
Written by Robert Corbett and Richard Stallman.
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
通过将 export PATH="/usr/local/opt/bison/bin:$PATH" 添加到我的 ~/.zshrc,bison 包含在我的路径中。为什么 doxygen cmake 命令会引用旧的 bison 2.3?
【问题讨论】:
-
在 Cygwin 上,我也使用提到的版本并且没有出现错误(并且在调试时我确实看到我们获得了 Bison 的 3.8.2 版)。您使用的是哪个版本的 CMake?
-
也许您的系统上有多个 Bison 版本,并且根据使用的 shell 选择不同的版本。将 CMakeLists.txt 中的第 112 行更改为
message(SEND_ERROR "Doxygen requires at least bison version 2.7 (installed: ${BISON_VERSION}, from: ${BISON_EXECUTABLE})"),看看会发生什么。 -
在命令行中设置
-DBISON_ROOT=/usr/local/opt/bison是否可以修复它? -
@AlexReinking,不,有人告诉我 dbison_root 已经是那条路了。
-
/usr/bin/bison -V给出了什么?貌似/usr/bin里的bison版本是老版本,没看到/usr/local/opt里的版本。我不知道-DBISON_ROOT=/usr/local/opt/bison是否有帮助,否则-DBISON_EXECUTABLE=/usr/local/opt/bison可能会这样做。