Page 1 of 1
Meaning of ImportC without a library file name
Posted: Wed Mar 25, 2020 8:23 pm
by QuimV
Code: Select all
ImportC ""
gmtime(*timer)
localtime(*timer)
setlocale(category, locale.p-UTF8)
strftime(*s, maxsize, format.p-UTF8, *timeptr)
EndImport
I have seen this piece of code that I do not understand why it works, although it works correctly.
According to the Purebasic help file, a library file name is required from which to import the functions it contains.
In this case, the Library file name does not exist, but the declared functions are available and can be used within the program.
Can someone explain to me why a library file name is not essential in this code?
Thank you
Re: Meaning of ImportC without a library file name
Posted: Wed Mar 25, 2020 8:24 pm
by Fred
It uses functions of the libc which is always linked with the PureBasic exe, so you don't have to put something in.
Re: Meaning of ImportC without a library file name
Posted: Wed Mar 25, 2020 8:26 pm
by QuimV

I understand now!
Where can I find a list of the functions contained in the "libc" library?
Thanks in advanced
Re: Meaning of ImportC without a library file name
Posted: Thu Mar 26, 2020 3:27 am
by kpeters58
Not all libc libraries are created equal, see here:
https://en.wikipedia.org/wiki/C_standard_library
Re: Meaning of ImportC without a library file name
Posted: Thu Mar 26, 2020 7:37 am
by QuimV

OK, Thank you very much to all