How to call malloc in x86_64 asm

Viewed 438

I am trying to call malloc in Visual Studio Community 2019 assembly but I keep getting undefined reference to symbol malloc.

mov rcx,10h
call malloc

Does not compile as I get the undefined reference to malloc I have even tried it with _malloc with the same issue. Am I missing some sort of include?

1 Answers

This was solved by putting an extern in the data section

.data
extern malloc: proc
.code 
;Some code;
Related