Mail Archives: djgpp/1996/08/19/08:30:23
Xref: | news2.mv.net comp.os.msdos.djgpp:7624
|
From: | bmaddox AT cs DOT umr DOT edu (Brian Maddox)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Problems with the stl and djgpp?
|
Date: | 19 Aug 1996 01:39:24 GMT
|
Organization: | UMR Missouri's Technological University
|
Lines: | 48
|
Message-ID: | <4v8gkc$p7n@hptemp1.cc.umr.edu>
|
NNTP-Posting-Host: | sun4.cs.umr.edu
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Hey, I thought I'd try to compile some programs I wrote at work under
djgpp (which impresses the hell out of me so far) but when I try to
compile stuff with the stl, I get this error
cd g:/programs/stl/
gxx -Wall test6.cxx
test6.cc(.text+0xe1b): undefined reference to `operator new(unsigned
long, void *)'
Compilation finished at Sun Aug 18 20:32:22
Here,s the program I used
#include <algo.h>
#include <vector.h>
#include <assert.h>
#include <iostream.h>
int main(void)
{
const int N = 11; // Define array size
int array1[N] = {1, 2, 0, 3, 3, 0, 7, 7, 7, 0, 8}; // set up the array
int i; // counter
vector<int> vector1; // define a vector object for testing purposes
for (i = 0; i < N; ++i)
vector1.push_back(array1[i]);
// Output vector1 to show it's starting point
copy(vector1.begin(), vector1.end(), ostream_iterator<int>(cout, " "));
cout << endl;
// Eliminate consecutive duplicates from vector1;
vector<int>::iterator new_end;
new_end = unique(vector1.begin(), vector1.end());
// Prove that the size of vector1 hasn't changes
assert(vector1.size() == N);
// Okie, the consecutive nonduplicates are between begin() and new_end
// so go ahead and delete the rest of them
vector1.erase(new_end, vector1.end());
// Now output vector1 to show it worked
copy(vector1.begin(), vector1.end(), ostream_iterator<int>(cout, " "));
cout << endl;
}
Anyone else get this? Thanks!
--
Brian Gregory Maddox - bmaddox AT cs DOT umr DOT edu, bmaddox AT umr DOT edu - Computer Science
- Raw text -