delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/10/12/13:55:32

Date: Mon, 12 Oct 1998 13:53:48 -0400 (EDT)
From: Mark A Reed <marst96+@pitt.edu>
X-Sender: marst96 AT unixs3 DOT cis DOT pitt DOT edu
To: djgpp AT delorie DOT com
Subject: linking from nasm
Message-ID: <Pine.GSO.3.96L.981012134800.4282A-100000@unixs3.cis.pitt.edu>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

Could anyone help me out?

I used NASM and outputed with COFF, which it says you have to do to link
in the .o file with djgpp. Now I can't figure out how to do this.

I have a global function in my file assembled by NASM.
I want to use that in my .cpp file compiled by DJGPP. But, it keeps saying
can't find myGolbalFunc. How exactly do you link in the file? heres my
assembly code and cpp code.

global _myfunc
_myfunc: push ebp
         mov ebp,esp
         mov eax,[ebp+8]
         leave
         ret

now in my .cpp file

#include <iostream.h>

extern int _myfunc(int);

void main()
{
 int a = myfunc();
 cout << a;
}


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019