如何使用Makefile在cygwin上编译cli-clock?

时间:2013-03-17 15:06:38

标签: c cygwin

我写了ggc clock.c -o clock,假设它会编译到文件“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

1 个答案:

答案 0 :(得分:3)

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

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

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

请注意,除非程序在Cygwin中进行测试,否则无论如何都无法保证。