SDL2 and KISS_SDL linking on macOS
actsl opened this issue · 3 comments
I don't know by now what to do with it, so i created this issue myself. It was posted in Satck Overflow https://stackoverflow.com/questions/69351191/sdl2-and-kiss-sdl-trouble-linking-on-macos
The SDL include files are not used to be under SDL2 for MSVC and Mac, thus so far the code has worked for these using MSVC or Mac. But now for the first time someone had a problem who uses Mac and has SDL include files under SDL2. I'm willing to fix it if it is an issue, but i don't know by now what to do, if there were some compiler macros for that case, then i could use them. Otherwise i don't know by now when and for what compiler are the SDL libraries installed under SDL2 in Mac, and when they are not.
In Mac, the include files and libraries for linking are determined by framework. The framework for SDL2 should thus provide the include files and libraries, and there is no need for specifying SDL2 directory. In what case is it different and how to find it out is by now not certain. I don't have Mac, so i cannot find out whether it was just a result of wrongly installing the framework, some who have Mac may help. So i will leave this issue open until this becomes clear, and it can be decided whether there is a need to make any change or not.
By now the solution for these who may encounter that problem, is to edit kiss_makefile and add -U__APPLE__ to CFLAGS , this should prevent defining the macro __APPLE__
, if that solves it. The last option is to manually edit kiss_sdl.h file, but it may not go so far. Sorry for inconvenience in that case. I have thought to add a Python build script to the project, that may solve such unexpected issues, but because it adds an additional dependency on Python, i have so far avoided that.
I'm just going to mention myself here so that I remember to come back and test this @AVividLight
Thank you AVividLight. But i think that i see now, the one who had that problem, tried to build it with command line only, not using kiss_makefile. But in Mac, the libraries and headers are provided by framework, and that was not added to the command line. So it looks like that this is all the problem there was, one should use framework for building in Mac. Just please look at it and say whether you agree. And when you have done that, then maybe you could write a reply in Stack Overflow, as i cannot do that, i'm not in Stack Overflow. Thanks again.
PS I now also wrote a preliminary answer in Stack Overflow, without being a Stack Overflow user, i hope that it also stays there and is visible. If the answer is there, you may or may not write an answer in Stack Overflow after you test it, as this issue is referred there.
No more comments, so it looks like that there are no more problems and it was just about using it wrongly. I therefore close this issue now. Let me know in case there is any need to open it again. Thanks to everyone, but it seems to be clear now, and there is likely no need to do anything more about it. So thanks again and thanks to all the users of this toolkit, i hope that you had fun and were able to do what you wanted to do.