From: DavMac AT iname DOT com (Davin McCall) Newsgroups: comp.os.msdos.djgpp Subject: Re: compiling C++ Date: Fri, 05 Nov 1999 04:25:19 GMT Organization: Monash Uni Lines: 59 Distribution: world Message-ID: <38225bcb.13538055@newsserver.cc.monash.edu.au> References: <7vsnag$jhc AT hermes DOT acs DOT unt DOT edu> NNTP-Posting-Host: damcc5.halls.monash.edu.au X-Trace: towncrier.cc.monash.edu.au 941775925 3357 130.194.198.138 (5 Nov 1999 04:25:25 GMT) X-Complaints-To: abuse AT monash DOT edu DOT au NNTP-Posting-Date: 5 Nov 1999 04:25:25 GMT X-Newsreader: Forte Free Agent 1.1/32.230 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com The error message seems to pertain to a missing "main" function. However you obviously *do* have a main() function, which leads be to think that perhaps there might be something wrong with "StringUtils.h". Davin. On Thu, 4 Nov 1999 13:36:40 -0600, "Morpheus" wrote: >I have just installed djgpp according to all the directions (it seems). > >I have a certain module I cannot compile into an executable. It is called >IniUtils.cpp. Here's a brief rundown of it and it's .h file: > >*IniUtils.h* >#ifndef __INI_UTILS__ >#define __INI_UTILS__ > >// here's the class and prototypes for the methods. > >#endif __INI_UTILS__ > >*IniUtils.cpp* >#include >#include "StringUtils.h" // defined by me. >#include "IniUtils.h" > >// class methods are defined here > >int main() { > // do some stuff >} > >I use the following command to compile to an object file: > >gcc -c -Wall IniUtils.cpp > >with no errors. > >Later, I use the following command to compile to an executable: > >gxx -o IniUtils.exe IniUtils.o > >(sometimes I use gxx -o IniUtils.exe IniUtils.cpp) > >I get the following error: > >d:/djgpp/lib/crt0.o(.data+0xc2):crt0.s: undefined reference to `main' >d:/djgpp/lib/libc.a(crt1.o)(.text+0x446):crt1.c: undefined reference to >`main' > >My PATH and DJGPP environment variables are both pointing to the correct >places on the D: drive. __________________________________________________________ *** davmac - sharkin'!! davmac AT iname DOT com *** my programming page: http://yoyo.cc.monash.edu.au/~davmac/