作者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/m.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