Undefined symbols

在开发NDK 使用C++ 编写代码时,使用AES 加密时,在Xcode 提示Undefined symbols
因为在使用的地方使用的是C++ ,面AES您可能使用的是C语言.

你可以创建一个.hpp文件
添加如下

1
2
3
4
5
6
7
8
9
10
11
12
#ifndef _AES_HPP_
#define _AES_HPP_

#ifndef __cplusplus
#error Do not include the hpp header in a c project!
#endif //__cplusplus

extern "C" {
#include "aes.h"
}

#endif //_AES_HPP_

C++ 与C语言有语法上的不同.