Undefined reference problem

David Holmes - Sun Microsystems David.Holmes at Sun.COM
Sun Nov 29 23:20:25 PST 2009


Thanks to all the 'anonymous' respondees :)

I am of course missing the the actual definition of _cond_attr in 
os_linux.cpp:

pthread_condattr_t os::Linux::_cond_attr [1];

David

David Holmes - Sun Microsystems said the following on 11/30/09 15:10:
> Sorry slight typo:
> 
> David Holmes - Sun Microsystems said the following on 11/30/09 15:04:
>> Newbie question I guess but it's got me perplexed :)
>>
>> In os::Linux I'm adding:
>>
>> static pthread_condattr_t _cond_attr[1];
>> public:
>> static pthread_condattr_t cond_attr() { return _cond_attr; }
> 
> That should of course be a pthread_condattr_t* for the return type.
> 
> David
> 
>> it compiles fine, but at link time I get an error:
>>
>> Undefined reference to: os::Linux::_cond_attr
>>
>> ??? What did I miss?
>>
>> Thanks,
>> David


More information about the hotspot-dev mailing list