Hi ALl,
I would like to create a project with cpp and I need to use timers, but I cannot use this file. My root CMakelist.txt contains this:
cmake_minimum_required(VERSION 3.5)
set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/examples/cxx/experimental/experimental_cpp_component")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(MyTestProject)
and my main/CMakelists.txt is:
idf_component_register(SRCS
"main.cpp"
"control.cpp"
INCLUDE_DIRS "."
REQUIRES nvs_flash json pthread esp_timer driver esp_event)
in config I enabled the compiler options/Enable C++ exceptions option.
in my control.h ther is:
#include "esp_exception.hpp"
#include "esp_timer_cxx.hpp"
compiler said:
esp_exception.hpp: No such file or directory
esp_timer_cxx.hpp: No such file or directory
How can I use timers?
thx,
Zamek
using esp_timer_cxx.hpp
Re: using esp_timer_cxx.hpp
Hi Zamek,
I think it will work if you add experimental_cpp_component to the REQUIRES list in idf_component_register.
(When you add experimental_cpp_component to EXTRA_COMPONENT_DIRS, this adds the component to the project. To let the build system know that your "main" component is using experimental_cpp_component, you need to list it in PRIV_REQUIRES or REQUIRES list)
I think it will work if you add experimental_cpp_component to the REQUIRES list in idf_component_register.
(When you add experimental_cpp_component to EXTRA_COMPONENT_DIRS, this adds the component to the project. To let the build system know that your "main" component is using experimental_cpp_component, you need to list it in PRIV_REQUIRES or REQUIRES list)
-
- Posts: 34
- Joined: Sat Dec 02, 2017 7:27 pm
Re: using esp_timer_cxx.hpp
Hi ESP_igrr,
It is part of my CMakelists.txt :
set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/examples/cxx/experimental/experimental_cpp_component")
but it is not enough.
thx
Zamek
It is part of my CMakelists.txt :
set(EXTRA_COMPONENT_DIRS "$ENV{IDF_PATH}/examples/cxx/experimental/experimental_cpp_component")
but it is not enough.
thx
Zamek
-
- Posts: 34
- Joined: Sat Dec 02, 2017 7:27 pm
Re: using esp_timer_cxx.hpp
Hi All,
Finally that was the needed config line in main/CMakeLists.txt:
PRIV_REQUIRES "experimental_cpp_component"
thx
Zamek
Finally that was the needed config line in main/CMakeLists.txt:
PRIV_REQUIRES "experimental_cpp_component"
thx
Zamek
Who is online
Users browsing this forum: jcolebaker and 112 guests