Undefined reference to "S_ISDIR" and "S_ISREG" when compiling with "-betterC"

rempas rempas at tutanota.com
Mon Jan 10 20:28:43 UTC 2022


On Monday, 10 January 2022 at 20:11:06 UTC, Adam D Ruppe wrote:
> On Monday, 10 January 2022 at 19:33:36 UTC, rempas wrote:
>> Thanks! It needs to be linked with which library?
>
> That segment of druntime.
>
> You can get dmd to do it for you by using the `-i -i=core.sys` 
> flags (or maybe just the -i=core.sys thing im not sure i 
> haven't actually tried).
>
> Or just stop using -brokenD and find joy lol
>
>> In C it doesn't need to be linked with nothing extra than the 
>> system library that the C compilers already link (unless you 
>> pass "-nostdlib" of course).
>
> In C, that I_ISDIR is a macro in the header file so there's 
> nothing to link, it all gets inlined by the preprocessor.

I see. Thanks! I will see what this function is supposed to do in 
the "stat.d" file or I'll write assembly and implement the system 
call be myself. Have a nice day my friend!


More information about the Digitalmars-d-learn mailing list