I'm a complete beginner and am currently taking the CS50 course. I want to use CLion, but for that I need to add a library to my project. I was able to download the CS50 library and "sudo make install" it. Now I need to add or link it to my project in CMake. But all of the sources I checked didn't really help me to know which files I need to link and how the process works as there seemed to be different approaches and none of them have worked for me so far. Please excuse the basic question I'm just lost.:) Thank you for your time and it would be super nice if someone can guide me in the right direction.
Asked
Active
Viewed 78 times
0
-
1You might like to know there is a CS50 stack here, example question [How do I install the CS50 library to my local OS?](https://cs50.stackexchange.com/questions/7291/how-do-i-install-the-cs50-library-to-my-local-os) althouhg it doesn't mention CLion. – Weather Vane Jun 25 '23 at 19:05
-
1As far as I can tell, [this](https://intellij-support.jetbrains.com/hc/en-us/articles/206558149) is the official CLion documentation on how to add a library to your project. However, unfortunately, I have never used CLion nor CMake, so I cannot help you with that link. I guess that you will also be unable to understand it. In that case, the simplest solution would probably be to add the file `cs50.c` as a source file to your project. This is what is recommended [here](https://www.reddit.com/r/cs50/comments/2rwnee/how_to_set_up_clion_for_cs50/). – Andreas Wenzel Jun 25 '23 at 19:20