I'm trying to make a super simple c++ and assembly project in Visual Studio, but when trying to call a function defined in main.cpp from boot.asm, I get an error: unresolved external symbol kernel_main
I've already declared the function with extern "C" and changed the item type of boot.asm to Microsoft Macro Assembler but the problem still persists.
boot.asm:
.code
org 07c00h
main:
jmp short start
ret
start:
cli
mov ax,cs
mov ds,ax
mov es,ax
mov ss,ax
mov bp,7c00h
mov sp,7c00h
sti
extern kernel_main : PROC
call kernel_main
ret
END
main.cpp:
#include "main.h"
using namespace miniOS;
extern "C" int kernel_main()
{
MiniOS::init();
MiniOS::run();
MiniOS::close();
return 0;
}
main.h
#pragma once
#include "MiniOS.h"
extern "C" int kernel_main();