Mail Archives: djgpp/1996/06/16/12:51:56
Xref: | news2.mv.net comp.os.msdos.djgpp:5041
|
From: | brucef AT central DOT co DOT nz (Bruce Foley)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Help new user with linking problems...
|
Date: | Sat, 15 Jun 1996 20:40:15 GMT
|
Organization: | Internet Company of New Zealand
|
Lines: | 28
|
Message-ID: | <4pvael$dic@status.gen.nz>
|
NNTP-Posting-Host: | brucef.central.co.nz
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Hi.
I have just downloaded DJGPP. Up until now I have been a Borland
User, and have (almost) completed my first game using these tools.
Since I want to move to a DPMI environment for future efforts, and
having heard about this great GNU port called DJGPP, I have decided to
have a look.
I'm pretty damn impressed, but I have hit my first problem, which I am
sure has a simple and obvious answer.
I want to be able to write external assembler routines to supplement
my main C program. With this in mind, I wrote a simple AT&T module
and assembled it with "as", producing a .o object file.
By looking at other code, it appears that all I need to do is declare
the routine as .global to make it accessable to a C program.
I then wrote a simple C program that prototypes the external routine
as extern, but I get an "undefined reference" error message in my C
program when linking. What am I doing wrong? I used the following
command lines:
gcc -o test.exe s1.s c1.c
gcc -o test.exe s1.o c1.c
<and a few others> but I always get the same error.
Any help would be greatly appreciated.
Bruce.
- Raw text -