天天看點

[二進制學習筆記]Linux執行C語言read函數Linux執行C語言read函數

文章目錄

  • Linux執行C語言read函數

Linux執行C語言read函數

[二進制學習筆記]Linux執行C語言read函數Linux執行C語言read函數

​ 如果在linux環境下,不做任何處理預設編譯含有read函數的c檔案,會發現能夠成功編譯并執行,但是在編譯過程中會爆出warning(警告):

test.c:5:5: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration]

這是因為在編譯過程中沒有靜态導入或者動态加載相關的dll檔案引起無法直接編譯。 我們可以通過導入相應的庫檔案(#include<unistd.h>)消除該警告:

[二進制學習筆記]Linux執行C語言read函數Linux執行C語言read函數

繼續閱讀