Code: Select all
class FooClass
{
private:
static int foo;
public:
static void bar (void);
};
...
void FooClass::bar (void)
{
foo = 0;
}
Code: Select all
fooclass.o(.text+0x20): In function `FooClass::bar()':
: undefined reference to `FooClass::foo'
My linker script looks like this:
Code: Select all
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
. = 0x00100000;
.text ALIGN (0x1000) :
{
*(.text)
*(.rodata*)
}
.data ALIGN (0x1000) :
{
start_ctors = .;
*(.ctor*)
end_ctors = .;
start_dtors = .;
*(.dtor*)
end_dtors = .;
*(.data)
}
.bss ALIGN (0x1000) :
{
_sbss = .;
*(COMMON)
*(.bss)
_ebss = .;
}
}
Is there something I need to add to my linker script to get this to work or what?
Thanks in advance guys.