Clion: Could NOT find SDL2... Even when I put everything in the exact location Follow
So when loading the Cmake for SDL2, I got this error.
Could NOT find SDL2 (missing: SDL2_LIBRARY SDL2_INCLUDE_DIR)
Problem is, I have put everything in the correct location:
- The Path in the FindSDL2.Cmake file:
- The SDL2 Library
So I am 100% sure that this is not because of me writing some wrong location. To prove it further, I have added the PATH_SUFFIXES to the SDL2_INCLUDE_DIR:
After doing so, it only becomes:
So, yeah, to add for information, if I change the SDL2 files to some other folders, it sometimes work, and sometimes doesn't. I am 200% sure this is not my fault of setting the wrong directory.
This stupid error has been torturing me for a week now.
Please, any idea on how to fix this :<
Please sign in to leave a comment.
Please read the following forum post and comments: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000770164/comments/360000002010
I pushed Enter by an error so the page published my question without information. I have edited my post. Please unmark my question as answered.
On the following screenshot there is the unnecessary [ in the path:
Is it like this in your real project? Could you please remove it and reload the CMake project (Tools | CMake | Reset Cache and Reload Project)?
okay, I see the problem. It seems that the [ is from my stupidity for sure, but Cmake sometimes keeps holding to the old Cmake cache I think, so delete CMakeCache.txt to make sure it reloads.
Thank you for the [ , my savior.
I'm glad that resetting cache helped! :)