On Thu, 2003-12-04 at 15:44, Ralph Blach wrote: > Is the C++ stl included in redhat 9.0. If it is, how do i compile with it. > If not where do I get the source?
Recent versions of GCC come with an STL implementation since its part of
the C++ standard. So if you install all of the GCC packages (including
"libstdc++-devel-3.2.2-5"), then the headers you need are there.
Heres a quick demo of how to use them:
cat <<EOF > test.cpp
#include <vector>
#include <iostream>
int main(int argc, char ** argv) {
std::vector<double> v;
for (int i=0; i<3; i++) {
v.push_back(double(i) + 100.5);
std::cout << i << ": " << v[i] << std::endl;
}
return 0;
}
EOF
make test
./test
hth,
Ed
--
Edward H. Hill III, PhD
office: MIT Dept. of EAPS; Room 54-1424; 77 Massachusetts Ave.
Cambridge, MA 02139-4307
email: [EMAIL PROTECTED], [EMAIL PROTECTED]
URL: http://web.mit.edu/eh3/
phone: 617-253-0098
fax: 617-253-4464
signature.asc
Description: This is a digitally signed message part
-- TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug TriLUG Organizational FAQ : http://trilug.org/faq/ TriLUG Member Services FAQ : http://members.trilug.org/services_faq/ TriLUG PGP Keyring : http://trilug.org/~chrish/trilug.asc
