MartinHelmut / cpp-gui-template-sdl2

C++ GUI starter project template with CMake and Cpack, Dear ImGui, and SDL2.
MIT License
71 stars 7 forks source link

How to get CLion to recognize all the symbols? #10

Closed innegatives closed 1 year ago

innegatives commented 1 year ago

Thanks for this template, it is really useful.

One issue I'm facing though is getting my IDE to recognize all the symbols. I already tried Neovim but gave up on it and installed CLion to see maybe it is better at that, but it still doesn't recognize SDL stuff.

See the attached screenshot.

Any ideas how to fix this? What is your own setup like? 2023-06-08-034701_1366x768_scrot

MartinHelmut commented 1 year ago

Hey, nice to hear it is of use to you ☺️

I'm using CLion myself without problems (macOS and Windows). It seems like the CMake configure step did not execute for you? 🤔 This is where CMake's FetchContent will fetch SDL2 and other dependencies (ref). You can check this by right-clicking on your project folder to "Reload CMake project". The pop-up looks something like this:

project-menu

You can validate this by looking at your CMake console in CLion, it should print the message "Fetching SDL ..." and show no errors. You can also if you like attach the CMake log output from CLion here in this issue.

If this leads to no success, another option is to manually run the configure step via terminal as defined in the build docs. The TL;DR is:

# You don't need to use Ninja
cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -B build/debug

And try to build via:

cmake --build build/debug

If non of this helps I can suggest more options that maybe help, but let's try this first 😅