Mail Archives: djgpp/1999/11/07/22:30:22
From: | "Morpheus" <hall AT silo DOT csci DOT unt DOT edu>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | make/linking trouble
|
Date: | Sun, 7 Nov 1999 19:28:42 -0600
|
Organization: | Zion
|
Lines: | 54
|
Message-ID: | <80592o$mnp@hermes.acs.unt.edu>
|
NNTP-Posting-Host: | dfw-premium-45.dialup.unt.edu
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 5.00.2314.1300
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2314.1300
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
I am getting very frustrated, as I am out of practice with my C++. I'm
having particular trouble with the make utility. I THINK I'm doing this
right. I have four modules, one with a class (IniUtils.h & .cpp), two with
functions (StringUtils.h & .cpp and FileUtils.h & .cpp), and one with a
"main" function to test them (IniTest.cpp). I've included my Makefile. I
won't include the other files (I will post them as replies). But I will say
that IniUtils requires StringUtils and FileUtils, StringUtils requires
FileUtils, FileUtils requires StringUtils, and IniTest is only testing
IniUtils (its IniFile class), so it only includes IniUtils.h.
*Makefile*
OBJS = IniTest.o IniUtils.o StringUtils.o FileUtils.o
EXES = initest.exe
CXX = redir -o gcc.log -eo gxx
CXXFLAGS = -g -Wall
ERR =
$(EXES): $(OBJS)
$(CXX) $(CXXFLAGS) -o $(EXES) $(OBJS) $(ERR)
IniTest.o: IniTest.cpp IniUtils.h StringUtils.h FileUtils.h
$(CXX) $(CXXFLAGS) -c IniTest.cpp $(ERR)
IniUtils.o: IniUtils.cpp IniUtils.h
$(CXX) $(CXXFLAGS) -c IniUtils.cpp $(ERR)
StringUtils.o: StringUtils.cpp StringUtils.h
$(CXX) $(CXXFLAGS) -c StringUtils.cpp $(ERR)
FileUtils.o: FileUtils.cpp FileUtils.h
$(CXX) $(CXXFLAGS) -c FileUtils.cpp $(ERR)
clean:
del *.o
Here's the error message from gcc.log:
IniTest.o: In function `main':
IniTest.cpp:1: undefined reference to `IniFile::IniFile(char *)'
IniTest.cpp:2: undefined reference to `IniFile::setActiveSection(char *)'
IniTest.cpp:3: undefined reference to `IniFile::getValue(char *)'
If anyone can help, I'd appreciate it. You can email or post here. =)
Morpheus.
--
Email: hall AT cs DOT unt DOT edu
Web: http://people.unt.edu/~dahall
"You'll tell yourself, 'I don't believe in any of this fake crap!'"
- Raw text -