I have been researching via Google and referencing http://www.cs.virginia.edu/~evans/cs216/guides/vsasm.html but I am wondering if anyone has any ideas on how to fix this not found error. The 'clear();' in extern "C" has a not found error. I hope this question is specific enough that it can be resolved. Any advice would be greatly appreciated.
This is the .cpp file.
extern "C" {
void clear();
}
int main() {
clear();
return 1;
}
This is the .asm file.
.586 ;Target processor. Use instructions for Pentium class machines
.MODEL FLAT, C ;Use the flat memory model. Use C calling conventions
.STACK ;Define a stack segment of 1KB (Not required for this example)
.DATA ;Create a near data segment. Local variables are declared after
;this directive (Not required for this example)
.CODE ;Indicates the start of a code segment.
clear PROC
xor eax, eax
xor ebx, ebx
ret
clear ENDP
END
In Visual Studio I have the masm turned on in Build Customization Files. I also have exclude from build set to 'No'.
The command line property in Custom Build Step looks like this:
ml /Cx /coff clear.asm /link /SUBSYSTEM:console /out:go /entry:clear
When I build to solution/project/each file individually it succeeds but I can't figure out why the 'clear();' in the following --> has a green squiggly indicating a not found error.
extern "C" {
void clear();
}