Page 1 of 1

How to compile a kernel in C++ using a cross compiler?

Posted: Mon May 08, 2017 8:10 pm
by sofferjacob
I recently started porting my kernel project to c++ (from C) and tried to compile it with the same cross compiler I use to compile my C kernel. The problem is that GCC calls Ubuntu's G++ instead of calling the cross-compiler G++. Therefore when the cross compiler linker tries to link the kernel it can't read the object files. How do I fix this?

Thanks in advance

Re: How to compile a kernel in C++ using a cross compiler?

Posted: Mon May 08, 2017 11:56 pm
by iansjack
When you created the cross-compiler did you specify C++ as one of the languages it could compile?

Re: How to compile a kernel in C++ using a cross compiler?

Posted: Tue May 09, 2017 7:49 am
by Korona
Do you invoke {x86_64,i386}-{elf,youros}-g++ or plain g++? Is i386-elf-g++ in your path?