GCC meckert ohne Grund rum.



  • Hallo!

    Immer wenn ich mein Progrämmchen compiliere, spuckt GCC die folgende Warnung aus:

    In file included from /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/backward/strstream:51,
    from main.cpp:2:
    /usr/lib/gcc/i386-redhat-linux/3.4.2/../../../../include/c++/3.4.2/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <iostream> instead of the deprecated header <iostream.h>. To disable this warning use -Wno-deprecated.

    Mein Quelltext:

    #include<iostream>
    #include<strstream>
    using namespace std;
    
    #define KB (1024)
    #define MB (1024*1024)
    
    int main()
    {
      [...]
    

    Mein (oder Meine?) Makefile:

    main: main.cpp
            g++ main.cpp -omain
    

    Was ist da los?

    MfG
    godmother



  • lies doch mal die c++/3.4.2/backward/strstream und guck um zeile 51 rum, ob da genaueres steht.



  • GCC meckert nicht ohne Grund: <strstream> ist - obwohl es kein .h hat - DEPRECATED (alt). Benutze stattdessen <sstream> (Die dazugehörige Klasse heißt stringstream).

    Happy Coding!


Anmelden zum Antworten