J
JShrager
I just upgraded my server to a recent version of redhat, and now old
code no longer compiles. I'm not a C++ coder, but C++ coders who use
my server are now complaining. Here's an example:
#include <iostream>
#include <list>
#include <string>
using namespace std;
template<typename T>
void writeList(const list<T>& alist, const string& separator = " ")
{
list<T>::const_iterator iter;
for(iter = alist.begin(); iter != alist.end(); iter++)
cout << *iter << separator;
cout << endl;
}
int main()
{
return 0;
}
And I get this error:
t1.cpp: In function âvoid writeList(const std::list<T,
std::allocator<_CharT> >&, const std::string\
&)â:
t1.cpp:11: error: expected `;' before âiterâ
t1.cpp:12: error: âiterâ was not declared in this scope
The user who gave me this example claims that STD lib is somehow not
installed correctly on the new server, but I can't figure out what I
could install additionally. My (completely naive) guess is that his
code is deprecated.
Here's what I can find that might be relevant:
$ cd /usr/lib
$ find . -print | grep libstd
../libstdc++.so.5
../libstdc++-3-libc6.2-2-2.10.0.so
../gcc/x86_64-redhat-linux/4.1.1/libstdc++.a
../gcc/x86_64-redhat-linux/4.1.1/32/libstdc++.a
../gcc/x86_64-redhat-linux/4.1.1/32/libstdc++.so
../gcc/x86_64-redhat-linux/4.1.1/libstdc++.so
../libstdc++.so.6
../libstdc++.so.5.0.7
../libstdc++.so.6.0.8
../libstdc++-libc6.2-2.so.3
Thanks in advance!
code no longer compiles. I'm not a C++ coder, but C++ coders who use
my server are now complaining. Here's an example:
#include <iostream>
#include <list>
#include <string>
using namespace std;
template<typename T>
void writeList(const list<T>& alist, const string& separator = " ")
{
list<T>::const_iterator iter;
for(iter = alist.begin(); iter != alist.end(); iter++)
cout << *iter << separator;
cout << endl;
}
int main()
{
return 0;
}
And I get this error:
t1.cpp: In function âvoid writeList(const std::list<T,
std::allocator<_CharT> >&, const std::string\
&)â:
t1.cpp:11: error: expected `;' before âiterâ
t1.cpp:12: error: âiterâ was not declared in this scope
The user who gave me this example claims that STD lib is somehow not
installed correctly on the new server, but I can't figure out what I
could install additionally. My (completely naive) guess is that his
code is deprecated.
Here's what I can find that might be relevant:
$ cd /usr/lib
$ find . -print | grep libstd
../libstdc++.so.5
../libstdc++-3-libc6.2-2-2.10.0.so
../gcc/x86_64-redhat-linux/4.1.1/libstdc++.a
../gcc/x86_64-redhat-linux/4.1.1/32/libstdc++.a
../gcc/x86_64-redhat-linux/4.1.1/32/libstdc++.so
../gcc/x86_64-redhat-linux/4.1.1/libstdc++.so
../libstdc++.so.6
../libstdc++.so.5.0.7
../libstdc++.so.6.0.8
../libstdc++-libc6.2-2.so.3
Thanks in advance!