I'm having a weird problem with mbedtls security library. I've downloaded the newest version of it (link to download the .tar.gz) on my Ubuntu machine, then compiled it and copied the header files to /usr/include and the shared library files to the /usr/lib.
When I'm compiling my C++ program which calls the function mbedtls_cipher_cmac_starts from mbedtls/cmac.h, I get the undefined reference error Security.cpp:599: undefined reference to 'mbedtls_cipher_cmac_starts'. However, I have included and linked the libraries correctly (At least I think so, this is not an ordering problem, right?). The problem seems to be in the mbedtls library itself, as when I nm -D libmbedcrypto.so, I can't find the needed function. I also checked the libmbedtls.so but also no luck from there.
0000000000020206 T mbedtls_cipher_auth_decrypt
0000000000020128 T mbedtls_cipher_auth_encrypt
000000000001ff17 T mbedtls_cipher_check_tag
0000000000020022 T mbedtls_cipher_crypt
0000000000264960 D mbedtls_cipher_definitions
000000000001fb49 T mbedtls_cipher_finish
Although it seems to be in the library makefile when compiling the library. Also, it is weird that the header file (cmac.h) can be referenced from code, but it just won't compile because of the undefined references.
.afile. What is the question you want answered here?.sofiles. Compile time it does not say that anything is wrong. There are also some test files for cmac testing in the library provided, and compiling the library doesn't get stuck at those files. @TripleHound , I tried to read through the whole library README, but there was just the specific command to output.so-library for the shared use. I will look further, and email the library developer if I can't sort this issue myself. I think the library ordering is not the issue, as other functions from the same library do work.