undefined reference error

Im struggling using ctr-drbg library that I downloaded from Mbed TLS - Trusted Firmware

I want to use ctr-drbg.h in test() function but I am having an error as follow:
Im using Arduino Due.

libraries/aa/test.c.o: warning: common of `ctx' overridden by definition
sketch/aa.ino.cpp.o: warning: defined here
libraries/aa/test.c.o: In function `random':
Multiple libraries were found for "test.h"
/home/crypto/Arduino/libraries/aa/test.c:7: undefined reference to `mbedtls_ctr_drbg_random_with_add'
 Used: /home/crypto/Arduino/libraries/aa
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Due (Programming Port).


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "test.h"

void random(unsigned char *x, uint16_t xlen){
	if (mbedtls_ctr_drbg_random_with_add(&ctx, x, xlen, NULL, 0) != 0)
		printf("random generation failed\n");

void test(){
	uint64_t a[16];
        random((unsigned char*)a, 128);


#ifndef TEST_H
#define TEST_H

#ifdef __cplusplus
extern "C" {

#include "mbedtls-2.16.4/include/mbedtls/ctr_drbg.h"
mbedtls_ctr_drbg_context ctx;
void test();

#ifdef __cplusplus

I dont know why I got kinda error. The IDE code is as below:

#include "test.h"
void setup(){
void loop(){}

AFAIK the mbed and Arduino (Wiring) cores are not compatible.
The mbed code is referring to core/other functions and structures (eg:`mbedtls_ctr_drbg_random_with_add') that are not part of the Arduino environment.