ttlappalainen / NMEA2000

NMEA2000 library for Arduino

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation issue during compiling for ESP32

cvashivably opened this issue · comments

Hi Everyone,
During the compilation of "https://github.com/ttlappalainen/NMEA2000" code from the master branch for ESP32. I am facing a compilation issue printed below.
======================Compilation steps =====================================

  1. I installed the ESP32 IDF "ESP-IDF v5.1.1-305" and set the ESP32 target and ". ./export.sh" to set the paths as well.
  2. cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=$IDF_PATH/tools/cmake/toolchain-esp32.cmake
  3. cmake --build build

I am using Ubuntu 20.04LTS, but i upgraded the G++ library to g++-11 and the
libstdc++-11-dev/focal,now 11.4.0-2ubuntu120.04 amd64 [installed,automatic]
g++-11/focal,now 11.4.0-2ubuntu1
20.04 amd64 [installed]

but still i am facing this issue as mentioned below. I am trying to make the NMEA2000 as a component for esp-idf and then build the application code in it.

Is there any other way I can compile the code. Any help will be appreciated.

Another method of compiling is

  1. idf.py build
    I get error here too:

=============Compilation error for idf.py ====================
idf.py build
Executing action: all (aliases: build)
Running cmake in directory /home/shiva/can_controller/NMEA2000/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/root/.espressif/python_env/idf5.1_py3.8_env/bin/python -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /home/shiva/can_controller/NMEA2000"...
CMake Error at CMakeLists.txt:27 (idf_component_register):
Unknown CMake command "idf_component_register".

-- Configuring incomplete, errors occurred!
cmake failed with exit code 1, output of the command is in the /home/shiva/can_controller/NMEA2000/build/log/idf_py_stderr_output_7233 and /home/shiva/can_controller/NMEA2000/build/log/idf_py_stdout_output_7233

===================================================

========================== Compilation Errors listed below using cmake ** ==========================
cmake --build build
[ 42%] Built target nmea2000
[ 50%] Building CXX object third-party/catch/CMakeFiles/catch.dir/catch.cpp.obj
In file included from /home/shiva/can_controller/NMEA2000/third-party/catch/catch.cpp:26:
/home/shiva/can_controller/NMEA2000/third-party/catch/catch.hpp: In function 'void Catch::restorePreviousSignalHandlers()':
/home/shiva/can_controller/NMEA2000/third-party/catch/catch.hpp:10899:67: error: no matching function for call to 'sigaction::sigaction(int&, sigaction
, std::nullptr_t)'
10899 | sigaction(signalDefs[i].id, &oldSigActions[i], nullptr);
| ^
In file included from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/signal.h:6,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/time.h:158,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/pthread.h:30,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/xtensa-esp32-elf/bits/gthr-default.h:35,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/xtensa-esp32-elf/bits/gthr.h:148,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/ext/atomicity.h:35,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/bits/ios_base.h:39,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/ios:42,
from /root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/12.2.0/ostream:38,
from /home/shiva/can_controller/NMEA2000/third-party/catch/catch.hpp:1423:
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate: 'sigaction::sigaction()'
121 | struct sigaction
| ^~~~~~~~~
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate expects 0 arguments, 3 provided
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate: 'constexpr sigaction::sigaction(const sigaction&)'
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate expects 1 argument, 3 provided
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate: 'constexpr sigaction::sigaction(sigaction&&)'
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate expects 1 argument, 3 provided
/home/shiva/can_controller/NMEA2000/third-party/catch/catch.hpp:10902:42: error: no matching function for call to 'sigaltstack::sigaltstack(stack_t
, std::nullptr_t)'
10902 | sigaltstack(&oldSigStack, nullptr);
| ^
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate: 'sigaltstack::sigaltstack()'
153 | typedef struct sigaltstack {
| ^~~~~~~~~~~
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate expects 0 arguments, 2 provided
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate: 'constexpr sigaltstack::sigaltstack(const sigaltstack&)'
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate expects 1 argument, 2 provided
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate: 'constexpr sigaltstack::sigaltstack(sigaltstack&&)'
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate expects 1 argument, 2 provided
/home/shiva/can_controller/NMEA2000/third-party/catch/catch.hpp: In constructor 'Catch::FatalConditionHandler::FatalConditionHandler()':
/home/shiva/can_controller/NMEA2000/third-party/catch/catch.hpp:10924:57: error: 'SIGSTKSZ' was not declared in this scope; did you mean 'SIGSYS'?
10924 | altStackSize = std::max(static_cast<size_t>(SIGSTKSZ), minStackSizeForErrors);
| ^~~~~~~~
| SIGSYS
/home/shiva/can_controller/NMEA2000/third-party/catch/catch.hpp: In member function 'void Catch::FatalConditionHandler::engage_platform()':
/home/shiva/can_controller/NMEA2000/third-party/catch/catch.hpp:10941:44: error: no matching function for call to 'sigaltstack::sigaltstack(stack_t*, stack_t*)'
10941 | sigaltstack(&sigStack, &oldSigStack);
| ^
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate: 'sigaltstack::sigaltstack()'
153 | typedef struct sigaltstack {
| ^~~~~~~~~~~
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate expects 0 arguments, 2 provided
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate: 'constexpr sigaltstack::sigaltstack(const sigaltstack&)'
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate expects 1 argument, 2 provided
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate: 'constexpr sigaltstack::sigaltstack(sigaltstack&&)'
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:153:16: note: candidate expects 1 argument, 2 provided
/home/shiva/can_controller/NMEA2000/third-party/catch/catch.hpp:10945:23: error: 'SA_ONSTACK' was not declared in this scope
10945 | sa.sa_flags = SA_ONSTACK;
| ^~~~~~~~~~
/home/shiva/can_controller/NMEA2000/third-party/catch/catch.hpp:10947:63: error: no matching function for call to 'sigaction::sigaction(int&, sigaction*, sigaction*)'
10947 | sigaction(signalDefs[i].id, &sa, &oldSigActions[i]);
| ^
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate: 'sigaction::sigaction()'
121 | struct sigaction
| ^~~~~~~~~
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate expects 0 arguments, 3 provided
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate: 'constexpr sigaction::sigaction(const sigaction&)'
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate expects 1 argument, 3 provided
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate: 'constexpr sigaction::sigaction(sigaction&&)'
/root/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/xtensa-esp32-elf/sys-include/sys/signal.h:121:8: note: candidate expects 1 argument, 3 provided
make[2]: *** [third-party/catch/CMakeFiles/catch.dir/build.make:63: third-party/catch/CMakeFiles/catch.dir/catch.cpp.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:165: third-party/catch/CMakeFiles/catch.dir/all] Error 2
make: *** [Makefile:95: all] Error 2