簡體   English   中英

dirent.h的代碼在哪里(opendir,readdir,closedir)? 未定義的符號

[英]Where is the code for dirent.h (opendir, readdir, closedir)? Undefined symbol

我正在使用Tiny C編譯器編譯一些使用dirent.h的C代碼(只是試圖列出目錄的內容)當我編譯時,我得到這些錯誤:

tcc: error: undefined symbol 'opendir'
tcc: error: undefined symbol 'readdir'
tcc: error: undefined symbol 'closedir'

當我打開dirent.h時,這里有3個函數頭:

DIR* __cdecl opendir (const char*);
struct dirent* __cdecl readdir (DIR*);
int __cdecl closedir (DIR*);

這可能聽起來很愚蠢,但這些函數頭的實際代碼在哪里? 在我看來,這就是它不能編譯的原因。

編譯器如何只用標題編譯而不編譯.c代碼?

謝謝。

停止使用古老的編譯器。

只需使用GCC(MinGW-w64)或MSVC。 你需要剛剛在MinGW-w64 GCC中實現的POSIX功能,所以你就是這樣。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM