delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/25/14:20:56

From: "John S. Fine" <johnfine AT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: NASM function -> undefined reference
Date: Mon, 25 Jan 1999 13:56:50 -0500
Lines: 27
Message-ID: <36ACBE72.4F83@erols.com>
References: <36aca701 DOT 0 AT news DOT zeitung-online DOT net>
Mime-Version: 1.0
X-Trace: 0VqUuHMZ+ugCWwv/XPTMSh5Le5EUdSho8OicAJODh4E=
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 25 Jan 1999 18:58:02 GMT
X-Mailer: Mozilla 3.01 (Win95; U)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Florian Janoschek wrote:

> today I started to use NASM and djgpp together and soon encountered the
> following problem:

> GLOBAL _test
> SECTION .text
> _test: push ebp
. . .
> In C++ I wrote something like that:
> 
> extern void test(void);

  Since your NASM code uses DJGPP's C naming rules, not C++ name
mangling rules, you need to tell C++ that it is a C name.  I
never use C++ myself, but I think the syntax is:

extern "C" void test(void);

  Alternatively, you could change the NASM code to use the C++
name;  But I don't think the rules are documented anywhere, so
you might need to compile the C++ code once with -S in order
to generate a .s file and then look for test in the .s file
to see what the name really looks like.
-- 
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/

- Raw text -


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