delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/03/17:45:57

From: Alex Morgan <abmorga AT emory DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: problem: undefined reference
Date: Wed, 02 Jun 1999 21:58:49 -0400
Organization: Emory University
Lines: 59
Message-ID: <3755E159.30225169@emory.edu>
NNTP-Posting-Host: anx59-202.dialup.emory.edu
Mime-Version: 1.0
X-Trace: lendl.cc.emory.edu 928375210 11020 170.140.251.202 (3 Jun 1999 02:00:10 GMT)
X-Complaints-To: abuse AT emory DOT edu
NNTP-Posting-Date: 3 Jun 1999 02:00:10 GMT
X-Mailer: Mozilla 4.5 [en] (Win98; I)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi all.

I'm new to djgpp and I'm still trying to get the hang of it.  I have
read the FAQ and looked through the archives (I saw that there are lots
of people who have received a similar message), but I can't figure out
what to do.

I have a program that calls a command that resides in a library (named
libcs.a) that I made that resides in the c:\djgpp\lib directory (I also
have a copy of it in my pwd).  The program (see below) compiles fine,
but when gcc tries to link all of the files, I get this:

C:\djgpp\sources\02>gcc -v greeting.o -lcs -o greeting.exe
Reading specs from c:/djgpp/lib/specs
gcc version 2.8.1
 c:/djgpp/bin/ld.exe -o greeting.exe c:/djgpp/lib/crt0.o -Lc:/djgpp/lib
-Lc:/djg
pp/contrib/grx22/lib -Lc:/djgpp/cslib/windows
-Lc:/djgpp/lib/gcc-lib/djgpp/2.81
-Lc:/djgpp/bin -Lc:/djgpp/lib greeting.o -lcs -Tdjgpp.djl -lgcc -lc
-lgcc
greeting.o(.text+0x34):greeting.c: undefined reference to `GetLine'

The program, greeting.c, is as follows:

C:\Dev-C++\sources\02>type greeting.c
/*
 * File: greeting.c
 * ----------------
 * This program prints a more personal greeting than did
 * the original "Hello, world." program by reading in the
 * name of the user.
 */

#include <stdio.h>
#include "genlib.h"
#include "simpio.h"

main()
{
    string user;

    printf("What is your name? ");
    user = GetLine();
    printf("Hello, %s.\n", user);
}

Both "genlib.h" and "simpio.h" reside in c:\djgpp\include and the pwd (
I believe that djgpp should search my pwd for the "*.h" files, but I
wanted to be sure they were found.)

I could post the contents of both genlib.* and simpio.* if necessary.
BTW, I did not write these files; they came as part of a package for a
class that I'm taking.

Any suggestions on how to resolve this?

Alex

- Raw text -


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