delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/18/05:01:48

From: broeker AT acp3bf DOT knirsch DOT de (Hans-Bernhard Broeker)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: assembly procedures w/ extern
Date: 18 Sep 1999 09:46:38 +0200
Organization: RWTH Aachen, III. physikalisches Institut B
Message-ID: <7rvg0u$f2i@acp3bf.knirsch.de>
References: <37E31959 DOT A762AD50 AT powernet DOT net>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 937640800 1042 137.226.32.75 (18 Sep 1999 07:46:40 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 18 Sep 1999 07:46:40 GMT
X-Newsreader: TIN [version 1.2 PL2]
Lines: 24
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Bart Trzynadlowski (trzy AT powernet DOT net) wrote:
> Hi,
>     Ive been tearing my hair out trying to get extern to work in my
> DJGPP-compiled programs. What I want to do is have the program call an
> assembly subroutine. I declare it with extern but I can't even compile
> the program because it complains about an undefined reference. 

Careful, here. The message 'undefined reference' implies that you *did*
succeed in compiling the program, actually. It's the linker that failed,
probably because you didn't pass the .o file of the compiled .asm module,
along with the C part, when you did the final step. 

As a rough outline:

	nasm <options...> file1.asm -o file1.o
	gcc -c file2.c

	gcc -o program.exe file1.o file2.o


	
-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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