作者tatungtatung (tatungtatung)
看板C_and_CPP
标题[问题] enum Boolean {false, true};
时间Thu Apr 20 10:16:55 2023
开发平台(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)) ===|
一直无法修正
有人知道原因吗?
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 111.252.151.20 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/C_and_CPP/M.1681957017.A.EFE.html
1F:推 NciscalA: c++ 本身就有 boolean。true 跟 false 是保留字。 04/20 13:14
2F:推 johnjohnlin: 这个code太旧了吧 XD 04/20 21:06
3F:推 ctrlbreak: 我记得tc的graphics.h好像只是要连他的graphics.lib 04/21 09:25
4F:→ ctrlbreak: 要纯dos绘图模式下才能用 04/21 09:28
5F:→ MOONRAKER: 哇塞TC3 3202年还用这种死人骨头是犯法的 04/27 12:21
6F:→ saxontai: 楼上未来人? 04/27 22:38
7F:推 Schottky: 这位道友能在後山思过崖发现上古TC3秘笈也是莫大的机缘 04/28 02:29
8F:推 lc85301: 职业:考古学家 04/28 09:56
9F:推 Lipraxde: TC 的介面很潮耶,以前考古看到觉得能做成这样好强 04/28 11:51
10F:→ saxontai: turbo vision tui framework 04/28 16:10
11F:推 CoNsTaR: 不知道为什麽有种 enum class byte : uint8_t {}; 的既 05/06 06:19
12F:→ CoNsTaR: 视感 05/06 06:19