Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 339358

Summary: Doesn't link functions in a namespace but does link to function decalered as class' static
Product: [Tools] CDT Reporter: vadim
Component: cdt-buildAssignee: cdt-build-inbox <cdt-build-inbox>
Status: RESOLVED INVALID QA Contact: Andrew Gvozdev <angvoz.dev>
Severity: major    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description vadim CLA 2011-03-09 09:31:40 EST
Build Identifier: M20100211-1343

include file contains this:
namespace vm
{
void my_classless_function (void);
class some_class
 {
 static void my_class_function (void);
 }
};

cpp file contains this:
using namespace vm;

void some_function (void)
{
some_class::my_class_function();
my_classless_function();   // generates "undefined reference to vm::my_classless_function()" error
}

Reproducible: Always
Comment 1 vadim CLA 2011-03-09 09:33:24 EST
linking to static library
Comment 2 Andrew Gvozdev CLA 2011-03-09 10:20:15 EST
Do you get the error as the result of compilation (i.e. in build console)?
Comment 3 vadim CLA 2011-03-11 11:06:55 EST
Yes
Comment 4 Andrew Gvozdev CLA 2011-03-11 11:49:08 EST
It's compiler complaining about an error in your code. It has nothing to do with CDT.