BackSpace7777777
BackSpace7777777

Reputation: 161

How to call malloc in x86_64 asm

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?

Upvotes: 3

Views: 1205

Answers (1)

BackSpace7777777
BackSpace7777777

Reputation: 161

This was solved by putting an extern in the data section

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

Upvotes: 2

Related Questions