Logo Search packages:      
Sourcecode: gcc-2.96 version File versions


  #include <time.h> 
  #include <stdio.h> 
  int main() 
    struct tm bdt; 
    strptime("2000-01-26 13:24:36","%Y-%m-%d %T", &bdt); 
gcc compiles this program correctly, but g++ fails to see the 
declaration of strptime in time.h: 
Adding "#define _XOPEN_SOURCE" allows g++ to compile it too. 

/usr/include/features.h says: 
   _XOPEN_SOURCE        Includes POSIX and XPG things.  Set to 500 if 
                        Single Unix conformance is wanted. 
   _GNU_SOURCE          All of the above, plus GNU extensions. 
   If none of these are defined, the default is all but _GNU_SOURCE. 
The documented default apparently works in gcc but not g++. 

Generated by  Doxygen 1.6.0   Back to index