I'm using CLion so I can (hopefully) have the ability to:
The general c++ style coloring is working, however, CLion won't notify me about syntax errors inside hps files:
Implementation of what I'm trying to include:
And as you can see, it does not detect it:
Now, this is the setup of my project:
I've set a CMakeLists.txt file that runs on MinGW environment. This is the full content of that file:
In another program called CodeLite for example, it's possible to just add to a list a path to search files to include, and then CodeLite parses those files and I can go to declarations of classes without any problems. Surely it's possible with CLion as well, right?
Is it possible that you have Power Save Mode activated from the File menu? If it is activated, some code-parsing features may be disabled.
I am guessing you already have the file type .hps
registered as a C/C++ file in Settings -> Editor -> File Types
. If not, you should register it!
You might need to configure some more properties like the project name and a target to associate the project with the files you are using.
cmake_minimum_required(VERSION 3.12)
project(YourProjectName VERSION 0.1.0)
include_directories(script/agents)
include_directories(script/areas)
include_directories(script/base)
add_executable(YourProjectName main.cpp header1.hpp source1.cpp path/to/header2.hpp path/to/source2.cpp)
If you are not building an executable, but a library, you might need to use add_library
instead. For the syntax you can check the documentation .
I hope this helps!
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.