试图了解如何链接结构中定义的函数,该函数位于汇编代码中,并试图从 c 中调用它。我认为当我调用该函数时缺少一个步骤,我得到一个未解析的外部符号......
;Assembly.asm
.686p
.mmx
.xmm
.model flat
include Definitions.inc
.code
?Initialize@Foo@@SIXPAUFee@@@Z proc
jmp $
?Initialize@Foo@@SIXPAUFee@@@Z endp
end
//CFile.c
struct Fee
{
signed long id;
}
struct Foo
{
static void Initialize(Fee *);
}
int startup(Fee * init)
{
Foo::Initialize(init); //<-- This is unresolved
return 0;
}