Code: Alles auswählen
#include <iostream>
#include <algorithm>
#include <cctype>
#include <string>
using namespace std;
int main(int argc, char *argv[])
{
string test = "hello WORLD";
transform (test.begin(), test.end(), test.begin(), toupper);
cout << test << endl;
return 0;
}
Code: Alles auswählen
cd '.../transfromtest/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -k
make all-recursive
Making all in src
compiling transfromtest.cpp (g++)
.../src/transfromtest.cpp: In function ‘int main(int, char**)’:
.../src/transfromtest.cpp:17: error: no matching function for call to ‘transform(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, <unresolved overloaded function type>)’
make[2]: *** [transfromtest.o] Error 1
make[2]: Target `all' not remade because of errors.
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
*** Exited with status: 2 ***
Ich verwende KDevelop 3.3.5 mit g++ 4.1.2. (z.B. kann ich das Beispiel mit C++ Builder von Borland unter Windows kompilieren...)
Vielen Dank für Eure Hilfe!
- Adrian
[1]
http://www.josuttis.com/libbook/string/iter1.cpp.html