[问题] enum Boolean {false, true};

楼主: tatungtatung (tatungtatung)   2023-04-20 10:16:55
开发平台(Platform): (Ex: Win10, Linux, ...)
codeblocks + GNU GCC Compiler
编译器(Ex: GCC, clang, VC++...)+目标环境(跟开发平台不同的话需列出)
GNU GCC Compiler
额外使用到的函数库(Library Used): (Ex: OpenGL, ...)
tc3 circle.cpp
tc3 graphics.h
tc3 point.h
问题(Question):
最近看到多年前的 tc3, 内部有 graphics.h
就用 codeblocks + GNU GCC Compiler 编译
先打开 tc3 中的 example 中的 circle.cpp
并将 tc3 中的 graphic.h 复制到 MinGW 的 include 资料夹下
编译 circle.cpp 时
会引用到 tc3 中的 point.h 档案
编译显示 point.h 中的 enum Boolean {false, true}; 出现错误
错误讯息为
||=== Build file: "no target" in "no project" (compiler: unknown) ===|
C:\tc3\EXAMPLES\point.h|8|error: expected identifier before 'false'|
C:\tc3\EXAMPLES\point.h|8|error: expected '}' before 'false'|
C:\tc3\EXAMPLES\point.h|8|error: expected unqualified-id before 'false'|
C:\tc3\EXAMPLES\point.h|8|error: expected declaration before '}' token|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
一直无法修正
有人知道原因吗?
作者: NciscalA   2023-04-20 13:14:00
c++ 本身就有 boolean。true 跟 false 是保留字。
作者: johnjohnlin (嗯?)   2023-04-20 21:06:00
这个code太旧了吧 XD
作者: ctrlbreak   2023-04-21 09:25:00
我记得tc的graphics.h好像只是要连他的graphics.lib要纯dos绘图模式下才能用
作者: MOONRAKER (㊣牛鹤鳗毛人)   2023-04-27 12:21:00
哇塞TC3 3202年还用这种死人骨头是犯法的
作者: saxontai (黑暗,点缀孤零零的星)   2023-04-27 22:38:00
楼上未来人?
作者: Schottky (顺风相送)   2023-04-28 02:29:00
这位道友能在后山思过崖发现上古TC3秘笈也是莫大的机缘
作者: lc85301 (pomelocandy)   2023-04-28 09:56:00
职业:考古学家
作者: Lipraxde (Lipraxde)   2023-04-28 11:51:00
TC 的接口很潮耶,以前考古看到觉得能做成这样好强
作者: saxontai (黑暗,点缀孤零零的星)   2023-04-28 16:10:00
turbo vision tui framework
作者: CoNsTaR ((const *))   2023-05-06 06:19:00
不知道为什么有种 enum class byte : uint8_t {}; 的既视感

Links booklink

Contact Us: admin [ a t ] ucptt.com