0

我正在尝试消除我的链接错误,例如

dmd -debug -gc -unittest -D -Dd/home/per/.emacs.d/auto-builds/dmd/Debug-Boundscheck-Unittest/home/per/Work/cognia/ -w  ~/Work/cognia/t_geometry.d -of/home/per/.emacs.d/auto-builds/dmd/Debug-Boundscheck-Unittest/home/per/Work/cognia/t_geometry
/home/per/.emacs.d/auto-builds/dmd/Debug-Boundscheck-Unittest/home/per/Work/cognia/t_geometry.o:(.data+0x6d8): undefined reference to `_D4gl3n6linalg12__ModuleInfoZ'
/home/per/.emacs.d/auto-builds/dmd/Debug-Boundscheck-Unittest/home/per/Work/cognia/t_geometry.o: In function `_D4gl3n6linalg16__T6VectorTfVi4Z6Vector19__unittestL103_7189FNaNbNfZv':
/home/per/Work/cognia/gl3n/linalg.d:104: undefined reference to `_D4gl3n6linalg15__unittest_failFiZv'
/home/per/Work/cognia/gl3n/linalg.d:105: undefined reference to `_D4gl3n6linalg15__unittest_failFiZv'

通过使用ddemangle.dgithub 上的 dtools repo 作为

same_command_as_above | ddemangle

但我使用 DMD 2.063.2 和 git master 得到了相同的输出。

ddemangle.d 不是最新的吗?

更新:好的。谢谢!

same_command_as_above 2>&1 | ddemangle

破坏大部分消息,但不是全部。我想知道为什么。这里有几行

/home/per/Work/cognia/gl3n/linalg.d:1814: undefined reference to `void gl3n.linalg.__unittest_fail(int)'
/home/per/Work/cognia/gl3n/linalg.d:695: undefined reference to `_D4gl3n6linalg19__T6MatrixTfVi2Vi2Z6Matrix6__initZ'
/home/per/Work/cognia/gl3n/linalg.d:695: undefined reference to `_D4gl3n6linalg19__T6MatrixTfVi2Vi2Z6Matrix6__initZ'
/home/per/Work/cognia/gl3n/linalg.d:1815: undefined reference to `void gl3n.linalg.__unittest_fail(int)'

线索有人吗?

4

2 回答 2

1

确保您正在过滤程序发出的输出流。错误通常写入标准错误流,但上面的行只过滤标准输出流。

尝试将您的命令更改为:

same_command_as_above 2>&1 | ddemangle

2>&1将标准错误重定向到标准输出,允许ddemangle过滤标准输出和标准错误。

于 2013-08-28T19:10:28.207 回答
0

行。谢谢!

same_command_as_above 2>&1 | ddemangle

破坏大部分消息,但不是全部。我想知道为什么。这里有几行

/home/per/Work/cognia/gl3n/linalg.d:1814: undefined reference to `void gl3n.linalg.__unittest_fail(int)'
/home/per/Work/cognia/gl3n/linalg.d:695: undefined reference to `_D4gl3n6linalg19__T6MatrixTfVi2Vi2Z6Matrix6__initZ'
/home/per/Work/cognia/gl3n/linalg.d:695: undefined reference to `_D4gl3n6linalg19__T6MatrixTfVi2Vi2Z6Matrix6__initZ'
/home/per/Work/cognia/gl3n/linalg.d:1815: undefined reference to `void gl3n.linalg.__unittest_fail(int)'
/home/per/Work/cognia/gl3n/linalg.d:1817: undefined reference to `void gl3n.linalg.__unittest_fail(int)'
/home/per/Work/cognia/gl3n/linalg.d:1818: undefined reference to `void gl3n.linalg.__unittest_fail(int)'
/home/per/Work/cognia/gl3n/linalg.d:695: undefined reference to `_D4gl3n6linalg19__T6MatrixTfVi4Vi4Z6Matrix6__initZ'
/home/per/Work/cognia/gl3n/linalg.d:695: undefined reference to `_D4gl3n6linalg19__T6MatrixTfVi4Vi4Z6Matrix6__initZ'
/home/per/Work/cognia/gl3n/linalg.d:1820: undefined reference to `void gl3n.linalg.__unittest_fail(int)'
/home/per/Work/cognia/gl3n/linalg.d:695: undefined reference to `_D4gl3n6linalg19__T6MatrixTfVi4Vi4Z6Matrix6__initZ'
/home/per/Work/cognia/gl3n/linalg.d:695: undefined reference to `_D4gl3n6linalg19__T6MatrixTfVi4Vi4Z6Matrix6__initZ'
/home/per/Work/cognia/gl3n/linalg.d:1821: undefined reference to `void gl3n.linalg.__unittest_fail(int)'
/home/per/Work/cognia/gl3n/linalg.d:695: undefined reference to `_D4gl3n6linalg19__T6MatrixTfVi4Vi4Z6Matrix6__initZ'
/home/per/Work/cognia/gl3n/linalg.d:1823: undefined reference to `void gl3n.linalg.__unittest_fail(int)'
/home/per/Work/cognia/gl3n/linalg.d:695: undefined reference to `_D4gl3n6linalg19__T6MatrixTfVi4Vi4Z6Matrix6__initZ'

线索有人吗?

于 2013-08-28T20:05:07.743 回答