[問題] enum Boolean {false, true};

看板C_and_CPP (C/C++)作者 (tatungtatung)時間3年前 (2023/04/20 10:16), 編輯推噓7(705)
留言12則, 9人參與, 最新討論串1/1
開發平台(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://www.ptt.cc/bbs/C_and_CPP/M.1681957017.A.EFE.html

04/20 13:14, 3年前 , 1F
c++ 本身就有 boolean。true 跟 false 是保留字。
04/20 13:14, 1F

04/20 21:06, 3年前 , 2F
這個code太舊了吧 XD
04/20 21:06, 2F

04/21 09:25, 3年前 , 3F
我記得tc的graphics.h好像只是要連他的graphics.lib
04/21 09:25, 3F

04/21 09:28, 3年前 , 4F
要純dos繪圖模式下才能用
04/21 09:28, 4F

04/27 12:21, , 5F
哇塞TC3 3202年還用這種死人骨頭是犯法的
04/27 12:21, 5F

04/27 22:38, , 6F
樓上未來人?
04/27 22:38, 6F

04/28 02:29, , 7F
這位道友能在後山思過崖發現上古TC3秘笈也是莫大的機緣
04/28 02:29, 7F

04/28 09:56, , 8F
職業:考古學家
04/28 09:56, 8F

04/28 11:51, , 9F
TC 的介面很潮耶,以前考古看到覺得能做成這樣好強
04/28 11:51, 9F

04/28 16:10, , 10F
turbo vision tui framework
04/28 16:10, 10F

05/06 06:19, , 11F
不知道為什麼有種 enum class byte : uint8_t {}; 的既
05/06 06:19, 11F

05/06 06:19, , 12F
視感
05/06 06:19, 12F
文章代碼(AID): #1aGA2Px- (C_and_CPP)
文章代碼(AID): #1aGA2Px- (C_and_CPP)