gdc and gcc object linking issues

Kagamin spam at here.lot
Thu Jun 7 12:11:04 PDT 2012


On Thursday, 7 June 2012 at 14:12:56 UTC, Andrej Mitrovic wrote:
> This wasn't a collision error, it was a missing symbol error. 
> The
> variable is static, so it should be in the data or bss segment. 
> You
> seem to be talking about instance variables but that wasn't the 
> issue
> here.

You didn't define the variable. It doesn't matter in which 
section a variable is placed, but which module it's defined in. 
In D you have declarations in .di files, but .di files alone 
won't work as you won't have the declared variables' storage - 
you'll have to link to an object compiled from the corresponding 
.d file because .d has definitions and that's how actual D 
members *definitions* are compiled and their storage allocated in 
sections.


More information about the Digitalmars-d-learn mailing list