Closed Free-Pascal-meets-SDL-Website closed 7 years ago
I believe that's the case because the unit names themselves are lowercased in the files themselves. If the unit name would be SDL2_image
in the file itself, this would work as expected and may be a better choice than lowercasing all the filenames.
Good idea. Did you experience this issue, too?
For me though, your suggestion doesn't seem to be the reason for this (although I like the idea to change the unit names to match exactly their file names.)
Some units have matching file and unit names already:
The remaining files mismatch the unit names in terms of letter-capitalization:
For me all of them compile well under Linux Mint (Debian/Ubuntu based). For code completion (ctrl+space) I indeed experienced something strange for different projects. Usually code completion worked but sometimes it didn't. This was independent of the actually SDL2 units used. On closer look when checking for the sdl2 source path (Project > Project Options... > Paths), the field "Other unit files (-Fu)" was (surprisingly) empty if the error occured. For this project to compile though, it had to be filled at least one time (at least for the first compile the other day) because otherwise the project will refuse to compile at all.
I'm a little bit confused at the moment. Lazarus bug?
theres a working sdl bgi driver for c but im a massively confused here. c uses
seems to be the offender.
should I use uses SDL_BGI;
instead? and yes, im aware of the c linkage
If you include sdl.pas it should include everything. The only exceptions are sublibraries of SDL like net, audio, etc (which are in separate .pas files). So it should work, if you just include sdl.pas, else i've missed converting sdl_bgi.h || it was included in a new version.
My comment to #54 went unanswered, so I'm going to re-post it here.
To quote the FPC User Guide: (link)
On systems where filenames are case sensitive (such as UNIX and Linux), the compiler will :
Search for the original file name, i.e. preserves case.
Search for the filename all lowercased.
Search for the filename all uppercased.
As such, I think this issue could be fixed by just changing all the units to use all-lowercase filenames.
Fixed it. Sorry for the delay.
A reader reported this (ref):
I guess it has to do with the case sensitivity of file names in Linux. At the moment I can't try it out myself.