I just change :

function loadTGA(const filename: pansichar;...

to

function loadTGA(const filename: string;...