Linker error when calling Assembler function in C++
Posted: Sun Apr 29, 2007 2:57 am
Hi,
I´m reading this kernel tutorial. I´m now at the chapter about the GDT, and because I want a C++ kernel I made some changes at the code.
The header file looks like this:
The definition of the function is the same like in the tutorial.
In my asm file I defined gdt_flush, exactly the same like the one from the tutorial.
Everything compiles fine, but if I want to link the .o files, I get an error in file GDT.o: undefined reference to '__Z9gdt_flushv'.
I have no idea what is wrong with my code.
I´m reading this kernel tutorial. I´m now at the chapter about the GDT, and because I want a C++ kernel I made some changes at the code.
The header file looks like this:
Code: Select all
//function is defined in Loader.asm
extern void gdt_flush();
namespace GDT
{
//registers a GDT
void set_gate(int num, unsigned long base, unsigned long limit, unsigned char access, unsigned char gran);
//installs default GDTs
void install();
}
In my asm file I defined gdt_flush, exactly the same like the one from the tutorial.
Everything compiles fine, but if I want to link the .o files, I get an error in file GDT.o: undefined reference to '__Z9gdt_flushv'.
I have no idea what is wrong with my code.