gdc and gcc object linking issues
    Dmitry Olshansky 
    dmitry.olsh at gmail.com
       
    Wed Jun  6 11:39:46 PDT 2012
    
    
  
On 06.06.2012 22:20, Andrej Mitrovic wrote:
> This is a bit more related to C++ than D, it has to do with wrapping.
> I've got 4 files:
>
> test.h:
> class Class
> {
> public:
>      static int statField;
> };
>
Old boring C++ :)
Once you have this definition due to moronic linkage model (and probably 
some other reasonable things) you have to have:
int Class:statField;
declared somewhere in you cpp files that you link together so that 
compiler knows where to put it (in terms of obj files).
> But for variables it doesn't link. What am I doing wrong?
Nothing, C++ is pile of dirt. :)
-- 
Dmitry Olshansky
    
    
More information about the Digitalmars-d-learn
mailing list