digitalmars.D.learn - Global variable type does not match previous declaration
- Satoshi (9/9) Dec 13 2017 What means this error and how to solve it?
- Satoshi (5/14) Dec 13 2017 Compiling with
- Nicholas Wilson (5/24) Dec 14 2017 Can you add -vv to the command line and post the relevant portion
- Jacob Carlborg (7/17) Dec 14 2017 I think this can occur with LDC when the compiler sees multiple symbols
- Kagamin (2/6) Dec 14 2017 Try to write typeinfo as is without mixin.
What means this error and how to solve it? object.d-mixin-1072(1112): Error: Global variable type does not match previous declaration with same mangled name: _D10TypeInfo_m6__initZ Actually, I'm working on OS with minimal D runtime and I'm unable to compile object.d source code: https://github.com/Rikarin/Trinix/blob/a42a6e1fb4b87374b3e5ad8b9be501b080655ccd/Kernel/object.d Thanks
Dec 13 2017
On Wednesday, 13 December 2017 at 21:38:49 UTC, Satoshi wrote:What means this error and how to solve it? object.d-mixin-1072(1112): Error: Global variable type does not match previous declaration with same mangled name: _D10TypeInfo_m6__initZ Actually, I'm working on OS with minimal D runtime and I'm unable to compile object.d source code: https://github.com/Rikarin/Trinix/blob/a42a6e1fb4b87374b3e5ad8b9be501b080655ccd/Kernel/object.d ThanksCompiling with ldc2 -debuglib= -defaultlib= -code-model=kernel -disable-red-zone -w -wi -de -O3 -mattr=-sse -I../ -of=obj-amd64/object.d.o -c -deps=obj-amd64/object.d.o.o.dep object.d
Dec 13 2017
On Wednesday, 13 December 2017 at 21:39:40 UTC, Satoshi wrote:On Wednesday, 13 December 2017 at 21:38:49 UTC, Satoshi wrote:Can you add -vv to the command line and post the relevant portion of the result (i.e. the portion that correlates to the symbol that gives the error)? (You'll want to pipe the output to a file as it produces a lot of output.)What means this error and how to solve it? object.d-mixin-1072(1112): Error: Global variable type does not match previous declaration with same mangled name: _D10TypeInfo_m6__initZ Actually, I'm working on OS with minimal D runtime and I'm unable to compile object.d source code: https://github.com/Rikarin/Trinix/blob/a42a6e1fb4b87374b3e5ad8b9be501b080655ccd/Kernel/object.d ThanksCompiling with ldc2 -debuglib= -defaultlib= -code-model=kernel -disable-red-zone -w -wi -de -O3 -mattr=-sse -I../ -of=obj-amd64/object.d.o -c -deps=obj-amd64/object.d.o.o.dep object.d
Dec 14 2017
On Thursday, 14 December 2017 at 12:18:22 UTC, Nicholas Wilson wrote:On Wednesday, 13 December 2017 at 21:39:40 UTC, Satoshi wrote:Here is output from -vv https://gist.github.com/anonymous/0a48808969600a84a683c03df57b5a29On Wednesday, 13 December 2017 at 21:38:49 UTC, Satoshi wrote:Can you add -vv to the command line and post the relevant portion of the result (i.e. the portion that correlates to the symbol that gives the error)? (You'll want to pipe the output to a file as it produces a lot of output.)[...]Compiling with ldc2 -debuglib= -defaultlib= -code-model=kernel -disable-red-zone -w -wi -de -O3 -mattr=-sse -I../ -of=obj-amd64/object.d.o -c -deps=obj-amd64/object.d.o.o.dep object.d
Dec 14 2017
I commented out the TypeInfo declarations and got the same error but on different symbol. object.d(1569): Error: Function type does not match previously declared function with the same mangled name: _d_dynamic_cast https://github.com/Rikarin/Trinix/blob/master/Kernel/object.d#L1569 https://travis-ci.org/Rikarin/Trinix/builds/317288016?utm_source=github_status&utm_medium=notification I have no idea what's wrong with that. Any ideas? Thanks.
Dec 16 2017
On Saturday, 16 December 2017 at 09:04:05 UTC, Satoshi wrote:I commented out the TypeInfo declarations and got the same error but on different symbol. object.d(1569): Error: Function type does not match previously declared function with the same mangled name: _d_dynamic_cast https://github.com/Rikarin/Trinix/blob/master/Kernel/object.d#L1569 https://travis-ci.org/Rikarin/Trinix/builds/317288016?utm_source=github_status&utm_medium=notification I have no idea what's wrong with that. Any ideas? Thanks.Actually, it seems like bug in LDC (compilation with DMD works fine). I opened issue https://github.com/ldc-developers/ldc/issues/2453
Dec 16 2017
On 2017-12-13 22:38, Satoshi wrote:What means this error and how to solve it? object.d-mixin-1072(1112): Error: Global variable type does not match previous declaration with same mangled name: _D10TypeInfo_m6__initZ Actually, I'm working on OS with minimal D runtime and I'm unable to compile object.d source code: https://github.com/Rikarin/Trinix/blob/a42a6e1fb4b87374b3e5ad8b9be501b08065 ccd/Kernel/object.dI think this can occur with LDC when the compiler sees multiple symbols that it think it should have the same mangled name but they don't. Or the opposite, multiple symbols that should have different mangled names but have the same. This is pretty easy to simulate with pragma(mangle). -- /Jacob Carlborg
Dec 14 2017
On Wednesday, 13 December 2017 at 21:38:49 UTC, Satoshi wrote:What means this error and how to solve it? object.d-mixin-1072(1112): Error: Global variable type does not match previous declaration with same mangled name: _D10TypeInfo_m6__initZTry to write typeinfo as is without mixin.
Dec 14 2017