[問題] 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