1. 程式人生 > >解決編譯錯誤 implicit declaration of function 'strptime'

解決編譯錯誤 implicit declaration of function 'strptime'

div 編譯選項 cit fine 編譯錯誤 定義 .com glibc this

根據man手冊,在文件中加上以下定義,應該可以去處該warning #define _XOPEN_SOURCE /* glibc2 needs this */ #include 但不起作用(重新編譯還是有該warning) 加上編譯選項-D_XOPEN_SOURCE又出現一大推其他編譯錯誤 最後在找到這篇帖子 http://stackoverflow.com/questions/15334558/compiler-gets-warnings-when-using-strptime-function-c 在編譯選項上同時加上-D_GNU_SOURCE -D__USE_XOPEN,即可解決

解決編譯錯誤 implicit declaration of function 'strptime'