TLPI 程式碼問答集
一般的錯誤與警告
問題一:Warning: "_XOPEN_SOURCE" redefined
warning: "_XOPEN_SOURCE" redefined$ cc -std=c99 -D_XOPEN_SOURCE=600
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE
#endif
#if ! defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 500
#define _XOPEN_SOURCE 500
#endif問題二:error: sys/acl.h: No such file or directory
問題三:error: sys/capability.h: No such file or directory
問題四:error: selinux/selinux.h: No such file or directory
編譯單一個檔案遇到的錯誤與警告
lib/cap_functions.c
lib/userns_functions.c
acl/acl_update.c
acl/acl_view.c
cap/cap_launcher.c
cap/cap_text.c
cap/check_password_caps.c
cap/demo_file_caps.c
cap/view_cap_xattr.c
dirs_links/list_files_readdir_r.c
filesys/t_mount.c
pgsjc/catch_SIGHUP.c
pgsjc/t_setsid.c
proc/setjmp_vars.c
shlibs/dynload.c
signals/nonatomic_uint64.c.c
threads/thread_multijoin.c
sockets/scm_security_send.c
time/strtime.c
time/t_stime.c
users_groups/check_password.c
General questions
Why are there "book" and "distribution" versions of the example source code?
Where is the file lib/ename.c.inc?
What version of the Linux kernel do I have on my system?
What version of glibc do I have on my system?
Why do I get warnings "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"?
Last updated