Mbedtls integration

Need to integrate Mbedtls for signature verification.I am getting
../../libraries/AP_CheckFirmware/AP_CheckFirmware.cpp:7:10: fatal error: mbedtls/sha256.h: No such file or directory #include <mbedtls/sha256.h>.
mbedtls path is /mnt/d/ardupilot/libraries/mbedtls.Path of the file which is consuming mbedtls library is /mnt/d/ardupilot/libraries/AP_CheckFirmware/AP_checkfirmware.cpp. tried to change the root level wscript but did not succeed. Any help would be appreciated. Thanks in advance.

You could start by describing everything that you’ve changed so we can see where to direct you to next

sure.
Root folder is /mnt/d/Ardupilot

1. Following changes I made in root level Makefile
MBEDTLS_PATH := /mnt/d/ardupilot/libraries/mbedtls
CFLAGS += -I$(MBEDTLS_PATH)/include
CFLAGS += -I$(MBEDTLS_PATH)/library
CPPFLAGS += -I./usr/bin/g++

2. following are root level wscript changes
def build(bld):
bld.env.INCLUDES += [‘mbedtls/include’]
bld.env.libraries +=[‘libraries/AP_CheckFirmware’]
bld.recurse(‘libraries/mbedtls’)

3. Header files in AP_Checkfirmware.cpp
#include <mbedtls/sha256.h>
#include <mbedtls/rsa.h>
#include <mbedtls/platform.h>
#include <mbedtls/md.h>

5. Path of header files
/mnt/d/ardupilot/libraries/mbedtls/include/mbedtls

6. Path of C files
/mnt/d/ardupilot/libraries/mbedtls/library/

7. Path of the file which is consuming the mbedtls library is :
/mnt/d/ardupilot/libraries/AP_Checkfirmware/AP_checkfirmware.cpp

I am a .Net, C# developer. I am new to c++ and python programming.

Thank you very much.

While this isn’t directly related to your problem, it needs investigation.

CFLAGS += -I$(MBEDTLS_PATH)/library

If this is supposed to indicate the path to the shared objects, then the flag needs to be something else.

CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"

Notice the difference between the -I (which is a capital i eye) and -L (which is a capital l ell)

The compiler might be able to pass the -L flags directly to the linker, but that is a problem to figure out for later.

The other thing is that unless you’ve followed some documentation that advises modifying the root Makefile, your changes might be getting removed

There is a verbosity setting somewhere that will print out the full compiler/linker line that is used to invoke each step, that will help you figure out if your include paths are making their way to the right place in the compilation step and allow you to verify their accuracy, but I am away from my dev machine so I’ll have to circle back on that, but maybe someone else can speak up about it.

I’ll try to circle back later in the week and see if I can work it out if you don’t get any bites before then. You may also try the discord, which is hopefully more active with respect to developer response