PerMalmberg / Smooth

C++ framework for embedded programming on top of Espressif's ESP-IDF.
Apache License 2.0
325 stars 30 forks source link

Build error on mac for esp platform #120

Closed flamedmg closed 4 years ago

flamedmg commented 4 years ago

build.log I tool native_ota_example from esp-idf framework and tried to integrate smooth into it. I failed to compile app then using idf.py build. It was building well before. Please advice. Build log attached.

squonk11 commented 4 years ago

I was facing the same problem after I updated the compiler and the esp-idf version. I temporarily fixed it by removing the compiler options "-Werror", "-Wconversion" and "-Wsign-conversion" from smooth/lib/compiler_options.cmake. Obviously these options are applied to the complete source (including esp-idf). Maybe the maintainer can find a way how to apply these to the local source of the user only?

PerMalmberg commented 4 years ago

You're probably building against a newer IDF-version than that Smooth has been tested against (v4.1-dev-281-g96b96ae24), or you're including parts of IDF that has not previously been used together with Smooth.

PerMalmberg commented 4 years ago

I've just updated the CI pipeline to build using today's master branch and all test projects builds fine locally. What IDF version are you using?

squonk11 commented 4 years ago

I am currently using: IDF Version:v4.1-dev-474-g2e6398aff-dirty. But I also newly installed development environment (on another PC) and I guess there is now another version of the compiler also.

PerMalmberg commented 4 years ago

I built using the one installed by the installer script in IDF.

On Mon, 23 Dec 2019, 10:21 Lothar, notifications@github.com wrote:

I am currently using: IDF Version:v4.1-dev-474-g2e6398aff-dirty. But I also newly installed development environment (on another PC) and I guess there is now another version of the compiler also.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/PerMalmberg/Smooth/issues/120?email_source=notifications&email_token=AAU2LLFCDHMPGH74AGNSYCTQ2B7IRA5CNFSM4J6NSCG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHQVFLQ#issuecomment-568414894, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU2LLDZZP5OXTH4QNQIKWLQ2B7IRANCNFSM4J6NSCGQ .

flamedmg commented 4 years ago

ESP-IDF v4.1-dev-1086-g93a8603c5 But getting same errors on latest version installed by IDF script

flamedmg commented 4 years ago

I was facing the same problem after I updated the compiler and the esp-idf version. I temporarily fixed it by removing the compiler options "-Werror", "-Wconversion" and "-Wsign-conversion" from smooth/lib/compiler_options.cmake. Obviously these options are applied to the complete source (including esp-idf). Maybe the maintainer can find a way how to apply these to the local source of the user only?

I excludede those compiler options and now getting different error, complier complaining on catch

error: exception handling disabled, use -fexceptions to enable
                 catch (...)

Here is a build log: build.log

PerMalmberg commented 4 years ago

error: exception handling disabled, use -fexceptions to enable catch (...)

So enable exceptions in menu config.

flamedmg commented 4 years ago

Project is compiling now, but i'm getting warning and errors during link:

/Users/dmg/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/smooth_component/libsmooth_component.a(Wifi.cpp.obj):(.literal._ZN6smooth4core7network4WifiC2Ev+0x8): undefined reference to `tcpip_adapter_init()'
/Users/dmg/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/smooth_component/libsmooth_component.a(Wifi.cpp.obj):(.literal._ZN6smooth4core7network4Wifi19wifi_event_callbackEPvPKciS3_+0x2c): undefined reference to `tcpip_adapter_set_hostname(tcpip_adapter_if_t, char const*)'
/Users/dmg/.espressif/tools/xtensa-esp32-elf/esp-2019r2-8.2.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.2.0/../../../../xtensa-esp32-elf/bin/ld: esp-idf/smooth_component/libsmooth_component.a(Wifi.cpp.obj): in function `smooth::core::network::Wifi::Wifi()':
/Users/dmg/Projects/home-auto/stove/externals/smooth/lib/smooth/core/network/Wifi.cpp:44: undefined reference to `tcpip_adapter_init()'
PerMalmberg commented 4 years ago

What have you tried to fix it?

Expectation management: Smooth is provided free of charge; that doesn't mean that I will fix all your issues. I'll more than likely work with you to to fix any actual issues with the framework or review PRs, but other than that I don't do free consulting.

That said, you probably haven't enabled something in menuconfig so the required code isn't being compiled. There's a sdkonfig in Smooth you can use as a template, or compare against.