www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/17/15:54:21

From: Al Calbazana <calbazan AT udel DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Cant make .exe files
Date: Sun, 16 Feb 1997 23:40:54 -0500
Organization: None
Lines: 70
Message-ID: <3307E155.1AF4@udel.edu>
Reply-To: calbazan AT udel DOT edu
NNTP-Posting-Host: ppp-pts14.nss.udel.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ive written a small program and have compiled it fine under UNIX.  I
wanted to use DJGPP to compile it under DOS.  Here is the code:

#include <iostream.h>
main ()
{

int x, y, z;

	cout << "Input 3 Different Integers: ";
	cin >> x >> y >> z;

cout << "Product is: " << x*y*z << endl;
cout << "Sum is: " << x+y+z << endl;
cout << "Average is: " << (x+y+z)/3 << endl;

// Largest

if (x > y && x > z)
	cout << x << " Is the Largest" << endl;
else
	if (y > x && y > z)
		cout << y << " Is the Largest" << endl;
else
	if (z > x && z > y)
		cout << z << " Is the Largest" << endl;

// Smallest

if (x < y && x < z)
	cout << x << " Is the Smallest" << endl;
else
	if (y < x && y < z)
		cout << y << " Is the Smallest" << endl;
else
	if (z < x && z < y)
		cout << z << " Is the Smallest" << endl;

 return 0;
}

No problems there.  But when I go to compile, I want an .exe file.

I use gcc filename.cc -o output_filename.exe

Heres a sample of the errors I get:

c:/djgpp/tmp\ccdaaaaa(.text+0x29f):math.cc: undefined reference to
`ostream::ope
rator<<(char const *)'
c:/djgpp/tmp\ccdaaaaa(.text+0x2ad):math.cc: undefined reference to
`ostream::ope
rator<<(ostream &(*)(ostream &))'
c:/djgpp/tmp\ccdaaaaa(.text+0x2cd):math.cc: undefined reference to
`endl(ostream
 &)'
c:/djgpp/tmp\ccdaaaaa(.text+0x2db):math.cc: undefined reference to
`cout'
c:/djgpp/tmp\ccdaaaaa(.text+0x2e0):math.cc: undefined reference to
`ostream::ope
rator<<(int)'

Its as if the iostream header was not read at all!

Any suggestions at all?! I just want to be able to compile this as a
test.

Thanks!

Al Calbazana

- Raw text -


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