# Trouble with adding OTA library into ESP32 project

**URL:** <https://forums.freertos.org/t/trouble-with-adding-ota-library-into-esp32-project/8976>\
**Category:** AWS\
**Created:** [December 19, 2019, 11:55pm UTC](https://forums.freertos.org/t/trouble-with-adding-ota-library-into-esp32-project/8976 "2019-12-19T23:55:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [December 19, 2019, 11:55pm UTC](https://forums.freertos.org/t/trouble-with-adding-ota-library-into-esp32-project/8976/1 "2019-12-19T23:55:23Z")

</div>

**[salkaleidoscope](https://forums.aws.amazon.com/profile.jspa?userID=494442)** wrote on December 19, 2019:

Hi,  
I have been having trouble trying to build my amazon freertos project with OTA library on ESP32 Wrover kit. I have my project setup similar to this project on github where we are using amazon-freertos as a submodule: Link: [[https://github.com/ParmanBabra/amazon-freertos-examples](https://github.com/ParmanBabra/amazon-freertos-examples)]

Similarly, in the CMakeLists.txt file at the root of my project I have

```auto
target_link_libraries(my_app PRIVATE AFR::ota)

```

to try and include the OTA library but we still get this error during the build:

```auto
[2/22] Building C object CMakeFiles/my_appdi...ertos_plus/aws/ota/src/mqtt/aws_iot_ota_mqtt.c.obj FAILED: CMakeFiles/my_app.dir/amazon-freertos/libraries/freertos_plus/aws/ota/src/mqtt/aws_iot_ota_mqtt.c.obj
../amazon-freertos/libraries/freertos_plus/aws/ota/src/mqtt/aws_iot_ota_mqtt.c:39:40: fatal error: aws_iot_ota_agent_internal.h: No such file or directory
[3/22] Building C object CMakeFiles/my_app.di...ertos_plus/aws/ota/src/http/aws_iot_ota_http.c.obj FAILED: CMakeFiles/my_app.dir/amazon-freertos/libraries/freertos_plus/aws/ota/src/http/aws_iot_ota_http.c.obj../amazon-freertos/libraries/freertos_plus/aws/ota/src/http/aws_iot_ota_http.c:43:40: fatal error: aws_iot_ota_agent_internal.h: No such file or directory

```

Is there an error in the include directories for the OTA since library since both aws\_iot\_ota\_mqtt.c and as\_iot\_ota\_http.c files can’t seem to find aws\_iot\_ota\_agent\_internal.h? or is there some other way I need to include the OTA library in my project?

---

<div class="post-metadata">

**Author:** ![tiangs](https://avatars.discourse-cdn.com/v4/letter/t/8c91f0/32.png) [@tiangs](https://forums.freertos.org/u/tiangs)\
**Post date:** [December 23, 2019, 11:24pm UTC](https://forums.freertos.org/t/trouble-with-adding-ota-library-into-esp32-project/8976/2 "2019-12-23T23:24:23Z")

</div>

**[Tiangang-AWS](https://forums.aws.amazon.com/profile.jspa?userID=438804)** wrote on December 23, 2019:

Hi,

Sorry for the trouble, we’ve identified a bug from our 201912.00 release that will cause this. The fix is already pushed to master branch and will be available in next release. You can update your submodule to the latest master branch and this problem should go away. You can also check my example repo here, [https://github.com/tgsong/amazon-freertos-examples](https://github.com/tgsong/amazon-freertos-examples)

Tiangang

---

<div class="post-metadata">

**Author:** ![system](https://d2v6vdsk2p900z.cloudfront.net/original/1X/7fc8fdb729c645aab5b20282bbe34e57cb407be6.jpeg) [@system](https://forums.freertos.org/u/system)\
**Post date:** [January 6, 2020, 10:23pm UTC](https://forums.freertos.org/t/trouble-with-adding-ota-library-into-esp32-project/8976/3 "2020-01-06T22:23:10Z")

</div>

**[salkaleidoscope](https://forums.aws.amazon.com/profile.jspa?userID=494442)** wrote on January 06, 2020:

Thank you, this fixed the issue.
