You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IDE platform
Clion 2021.1.1
Build #CL-211.7142.21 (april 22 2021)
Description of problem
PlatformIO fails to include headers within CLion IDE. Current project structure works flawlessly in VSCode IDE.
Steps to Reproduce
Put header file in root/include
Put source file in root/src
#include header in src file
#include header in main.c
Actual Results
fatal error: failed to include <myHeader.h>
Expected Results
successful compilation, as it does in VSCode
If problems with PlatformIO Build System:
The content of platformio.ini:
; PlatformIO Project Configuration File;; Build options: build flags, source filter; Upload options: custom upload port, speed and extra flags; Library options: dependencies, extra library storages; Advanced options: extra scripting;; Please visit documentation for the other options and examples; https://docs.platformio.org/page/projectconf.html[env:esp32-s2-saola-1]platform = espressif32
board = esp32-s2-saola-1
framework = espidf
monitor_speed = 115200
CMakeLists.txt
# !!! WARNING !!! AUTO-GENERATED FILE, PLEASE DO NOT MODIFY IT AND USE
# https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
#
# If you need to override existing CMake configuration or add extra,
# please create `CMakeListsUser.txt` in the root of project.
# The `CMakeListsUser.txt` will not be overwritten by PlatformIO.
cmake_minimum_required(VERSION 3.13)
set(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_C_COMPILER_WORKS 1)
set(CMAKE_CXX_COMPILER_WORKS 1)
project("ESP32_S2_Saola1" C CXX)
include(CMakeListsPrivate.txt)
if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/CMakeListsUser.txt)
include(CMakeListsUser.txt)
endif()
add_custom_target(
Production ALL
COMMAND platformio -c clion run "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_target(
Debug ALL
COMMAND platformio -c clion run --target debug "$<$<NOT:$<CONFIG:All>>:-e${CMAKE_BUILD_TYPE}>"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_executable(Z_DUMMY_TARGET ${SRC_LIST})
If I put the headers in the src folder instead of include and use #include "myHeader.h" instead of "#include <myHeader.h>" it compiles headers fine.
Expected project structure compiles and works fine in VSCode but in Clion it does not, even after deleting CMakeLists.txt files and re-initializing the project.
The text was updated successfully, but these errors were encountered:
You're building the project in a wrong way. You're not supposed to be building with the CMake system, you must use the "PlatformIO upload" target and the build button, as outlined in the docs. On a sidenote, you will need to have MinGW installed (see here).
What kind of issue is this?
Bug
Configuration
Operating system:
Windows 10 x64 pro
PlatformIO Version (
platformio --version
):5.1.1
IDE platform
Clion 2021.1.1
Build #CL-211.7142.21 (april 22 2021)
Description of problem
PlatformIO fails to include headers within CLion IDE. Current project structure works flawlessly in VSCode IDE.
Steps to Reproduce
Put header file in root/include
Put source file in root/src
#include header in src file
#include header in main.c
Actual Results
fatal error: failed to include <myHeader.h>
Expected Results
successful compilation, as it does in VSCode
If problems with PlatformIO Build System:
The content of
platformio.ini
:CMakeLists.txt
CMakeListsPrivate.txt
Additional info
If I put the headers in the src folder instead of include and use
#include "myHeader.h"
instead of"#include <myHeader.h>"
it compiles headers fine.Expected project structure compiles and works fine in VSCode but in Clion it does not, even after deleting CMakeLists.txt files and re-initializing the project.
The text was updated successfully, but these errors were encountered: