delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/11/04/15:59:29

From: "Morpheus" <d_a_hall AT yahoo DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: compiling C++
Date: Thu, 4 Nov 1999 13:36:40 -0600
Organization: University of North Texas
Lines: 50
Message-ID: <7vsnag$jhc@hermes.acs.unt.edu>
NNTP-Posting-Host: dfw-premium-4.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 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 <fstream.h>
#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.

I can't figure out what the problem is. Please help.

Morpheus.


- Raw text -


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