错误:
hdu_admin@hdu:~/neural_work/stf/cdl$ g++ -o sdk_api.so -shared -fPIC api.cpp
In file included from /usr/include/c++/5/chrono:35:0,
from api.cpp:7:
/usr/include/c++/5/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support \
^
api.cpp:85:25: warning: multi-character character constant [-Wmultichar]
header.bfType = 'MB';
^
api.cpp:18:5: error: ‘uint16_t’ does not name a type
uint16_t bfType;
解决:
使用g++ -o sdk_api.so -shared -fPIC api.cpp -std=c++11
即可