0

我写ggc clock.c -o clock假设它会编译到文件“时钟”,但显然不是。我确实看到它带有一个 Makefile,但我不太确定你如何使用它。

这是我正在使用的链接。 https://github.com/Unixhub/cli-clock

clock.c:6:21: ncurses.h: No such file or directory
clock.c:54: error: parse error before "WINDOW"
clock.c:54: warning: no semicolon at end of struct or union
clock.c:56: warning: data definition has no type or storage class
clock.c:68: error: parse error before '*' token
clock.c:68: warning: data definition has no type or storage class
clock.c: In function `init':
clock.c:89: error: request for member `bg' in something not a structure or union
clock.c:95: error: `stdscr' undeclared (first use in this function)
clock.c:95: error: (Each undeclared identifier is reported only once
clock.c:95: error: for each function it appears in.)
clock.c:99: error: `OK' undeclared (first use in this function)
clock.c:100: error: request for member `bg' in something not a structure or union
clock.c:102: error: request for member `bg' in something not a structure or union
clock.c:102: error: request for member `bg' in something not a structure or union
clock.c:103: error: request for member `bg' in something not a structure or union
clock.c:103: error: request for member `option' in something not a structure or union
clock.c:104: error: request for member `option' in something not a structure or union
clock.c:104: error: request for member `bg' in something not a structure or union
clock.c:115: error: request for member `running' in something not a structure or union
clock.c:116: error: request for member `geo' in something not a structure or union
clock.c:117: error: request for member `geo' in something not a structure or union
clock.c:118: error: request for member `geo' in something not a structure or union
clock.c:119: error: request for member `geo' in something not a structure or union
clock.c:120: error: request for member `geo' in something not a structure or union
clock.c:121: error: request for member `geo' in something not a structure or union
clock.c:122: error: request for member `tm' in something not a structure or union
clock.c:122: error: request for member `lt' in something not a structure or union
clock.c:123: error: request for member `lt' in something not a structure or union
clock.c:127: error: request for member `framewin' in something not a structure or union
clock.c:127: error: request for member `geo' in something not a structure or union
clock.c:128: error: request for member `geo' in something not a structure or union
clock.c:129: error: request for member `geo' in something not a structure or union
clock.c:130: error: request for member `geo' in something not a structure or union
clock.c:131: error: `LINES' undeclared (first use in this function)
clock.c:131: error: request for member `geo' in something not a structure or union
clock.c:132: error: `COLS' undeclared (first use in this function)
clock.c:132: error: request for member `geo' in something not a structure or union
clock.c:133: error: request for member `framewin' in something not a structure or union
clock.c:135: error: request for member `framewin' in something not a structure or union
clock.c: In function `signal_handler':
clock.c:149: error: request for member `running' in something not a structure or union
clock.c: In function `update_hour':
clock.c:158: error: request for member `tm' in something not a structure or union
clock.c:158: error: request for member `lt' in something not a structure or union
clock.c:159: error: request for member `lt' in something not a structure or union
clock.c:161: error: request for member `tm' in something not a structure or union
clock.c:164: error: request for member `date' in something not a structure or union
clock.c:165: error: request for member `date' in something not a structure or union
clock.c:168: error: request for member `date' in something not a structure or union
clock.c:168: error: request for member `tm' in something not a structure or union
clock.c:169: error: request for member `date' in something not a structure or union
clock.c:169: error: request for member `tm' in something not a structure or union
clock.c:172: error: request for member `date' in something not a structure or union
clock.c:172: error: request for member `tm' in something not a structure or union
clock.c:173: error: request for member `date' in something not a structure or union
clock.c:173: error: request for member `tm' in something not a structure or union
clock.c: In function `draw_number':
clock.c:189: error: request for member `framewin' in something not a structure or union
clock.c:190: error: request for member `framewin' in something not a structure or union
clock.c:192: error: request for member `framewin' in something not a structure or union
clock.c: In function `draw_clock':
clock.c:200: error: request for member `date' in something not a structure or union
clock.c:201: error: request for member `date' in something not a structure or union
clock.c:204: error: request for member `framewin' in something not a structure or union
clock.c:205: error: request for member `framewin' in something not a structure or union
clock.c:206: error: request for member `framewin' in something not a structure or union
clock.c:209: error: request for member `date' in something not a structure or union
clock.c:210: error: request for member `date' in something not a structure or union
clock.c:213: error: request for member `framewin' in something not a structure or union
clock.c:214: error: request for member `framewin' in something not a structure or union
clock.c:215: error: request for member `framewin' in something not a structure or union
clock.c:218: error: request for member `date' in something not a structure or union
clock.c:219: error: request for member `date' in something not a structure or union
clock.c: In function `clock_move':
clock.c:224: error: request for member `framewin' in something not a structure or union
clock.c:224: error: request for member `geo' in something not a structure or union
clock.c:224: error: request for member `geo' in something not a structure or union
clock.c: In function `key_event':
clock.c:231: error: request for member `option' in something not a structure or union
clock.c:232: error: `stdscr' undeclared (first use in this function)
clock.c:235: error: request for member `running' in something not a structure or union
clock.c: In function `main':
clock.c:247: error: request for member `option' in something not a structure or union
clock.c:247: error: `COLOR_BLUE' undeclared (first use in this function)
clock.c:248: error: request for member `option' in something not a structure or union
clock.c:250: error: request for member `running' in something not a structure or union
clock.c:259:2: warning: no newline at end of file
4

1 回答 1

2

Cygwin 很大,通常默认只安装一小部分。其余的分为单独安装的包。

您至少需要添加libncurses-devel包,可能还需要添加其他包。运行setup.exe,回答常见问题,输入ncurses搜索行,选择最新版本libncurses-devel,继续安装。

如果有 Makefile,请输入make它所在的目录。这将运行构建过程。

请注意,除非程序在 Cygwin 中进行了测试,否则没有任何保证。

于 2013-03-17T15:55:55.193 回答