【问题标题】:Error when Compiling PDCurses36 with TDM GCC 5.1.0使用 TDM GCC 5.1.0 编译 PDCurses36 时出错
【发布时间】:2018-07-02 21:23:57
【问题描述】:

尽管遵循 README.md 中提供的说明,我最近一直在努力构建 pdcurses36 的源代码。无论出于何种原因,我总是遇到同样的错误,因为“目标'pdcdisp.o'的配方失败”。这是错误提示:

C:\Program Files (x86)\CodeBlocks\pdcurs36\wincon>mingw32-make -f makefile
gcc -c -O2 -Wall -I.. ../wincon/pdcdisp.c
../wincon/pdcdisp.c: In function '_new_packet':
../wincon/pdcdisp.c:211:28: error: 'COMMON_LVB_UNDERSCORE' undeclared (first use in this function)
             mapped_attr |= COMMON_LVB_UNDERSCORE;
                            ^
../wincon/pdcdisp.c:211:28: note: each undeclared identifier is reported only once for each function it appears in
../wincon/pdcdisp.c:213:28: error: 'COMMON_LVB_GRID_LVERTICAL' undeclared (first use in this function)
             mapped_attr |= COMMON_LVB_GRID_LVERTICAL;
                            ^
../wincon/pdcdisp.c:215:28: error: 'COMMON_LVB_GRID_RVERTICAL' undeclared (first use in this function)
             mapped_attr |= COMMON_LVB_GRID_RVERTICAL;
                            ^
makefile:94: recipe for target 'pdcdisp.o' failed
mingw32-make: *** [pdcdisp.o] Error 1

这些是我向命令提示符发出的命令:

set PDCURSES_SRCDIR = C:\...\pdcurs36

path = C:\...\CodeBlocks\MinGW\bin

cd C:\...\pdcurs36\wincon

mingw32-make -f Makefile

我目前正在使用 TDM GCC 5.1.0(随代码块 17.12 的二进制构建提供的)和 pdcurs36.zip from the repository provided from the official site。我的操作系统是 Windows 10。

任何帮助将不胜感激。

编辑 我的意思是 17.12 版的代码块

【问题讨论】:

  • 我假设您的意思是 Codeblocks 17.12?
  • 是的。已修复。

标签: c++ mingw pdcurses


【解决方案1】:

我没有足够的代表评论,但您可能对this PDCurses commit 到 pdcdisp.c 感兴趣。

对旧编译器的警告;将 COMMON_LVB_* 替换为数字 安抚一些旧的编译器。在 Simon Sobisch 之后。

看起来 GCC 5.1.0 只是没有定义这些宏,所以它们对值进行了硬编码:

0x8000; /* COMMON_LVB_UNDERSCORE */
0x0800; /* COMMON_LVB_GRID_LVERTICAL */
0x1000; /* COMMON_LVB_GRID_RVERTICAL */

【讨论】:

  • 虽然提交修复了 pdcdisp.c,但我无法让 pdcscrn 工作。 pastebin.com/axMv3D8V 认为我应该切换到旧版本的 pdcurses?
  • 我个人建议使用更新版本的 MinGW。
  • 我会进一步评论,但不是在这里,以遵守 Stackoverflow 指南。在接下来的几天内观看 PDCurses GitHub。
  • TDM 似乎自 2015 年以来还没有发布 GCC 的构建。我也会安装 MinGW。他们有一个很好的设置 GUI(几乎是一个包管理器)和一个有用的入门。您还可以指示 CodeBlocks 非常轻松地使用该工具链。
  • 有没有人得到这个工作,因为我真的坚持这个
猜你喜欢
  • 1970-01-01
  • 2021-03-06
  • 1970-01-01
  • 1970-01-01
  • 2012-01-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多