gdc and gcc object linking issues

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Jun 7 16:58:11 PDT 2012


On 6/7/12, Kagamin <spam at here.lot> wrote:
> You didn't define the variable.

Aah, I see what's going on. See, I was using this in the context of
wrapping existing C++ libs. Since I was writing a small test-case for
wrapping a static field I made a header file with a static field
declaration but no .cpp implementation files (except the wrapper). I
didn't know I had to either have an initializer in the header or have
a .cpp file with the definition.

For actual C++ libs the definition of a static field is somewhere in
an existing cpp file, so I don't have to re-define the static field
when wrapping (otherwise I'd probably get collisions or multiple
independent variables).


More information about the Digitalmars-d-learn mailing list