2014-01-18 4 views
0

Я прочитал все другие сообщения, связанные с STL библиотеки и Android NDK с Eclipse, но я до сих пор эта проблема в моем JNI файле:Использование вектора Android NDK - Eclipse CDT

#include <vector> 

std::vector<std::string> test; 
test.push_back("hello"); 
std::vector<std::string>::size_type h = 0; 
unsigned int t = 0; 
std::string blah = test.at(h); 
std::string hell = test.at(t); 

at() является синтаксис, выделенный в обоих случаях со следующим сообщением об ошибке:

Invalid arguments ' 
Candidates are: 
stlpmtx_std::basic_string<char,stlpmtx_std::char_traits<char>,stlpmtx_std::allocator<char>> & at(?) 
const stlpmtx_std::basic_string<char,stlpmtx_std::char_traits<char>,stlpmtx_std::allocator<char>> & at(?) 
' 

Больше ничего не выделяется. Библиотека строит отлично. Тот же результат со встроенным типом данных, например vector<int>.

С:

int h = 0; 
memcpy(ar, res, h); 

Я получаю тетсру подсвечиваются следующее сообщение:

Invalid arguments ' 
Candidates are: 
void * memcpy(void *, const void *, ?) 
' 

Вот Application.mk:

APP_ABI := armeabi-v7a armeabi 
APP_OPTIM := release 
APP_STL := stlport_static 

и Android.mk:

LOCAL_PATH := $(call my-dir) 

include $(CLEAR_VARS) 

# *** Remember: Change -O0 into -O2 in add-applications.mk *** 

LOCAL_MODULE := soundtouch 
LOCAL_SRC_FILES := soundtouch-jni.cpp soundtouch/source/SoundTouch/AAFilter.cpp soundtouch/source/SoundTouch/FIFOSampleBuffer.cpp \ 
       soundtouch/source/SoundTouch/FIRFilter.cpp soundtouch/source/SoundTouch/cpu_detect_x86.cpp \ 
       soundtouch/source/SoundTouch/RateTransposer.cpp soundtouch/source/SoundTouch/SoundTouch.cpp \ 
       soundtouch/source/SoundTouch/TDStretch.cpp soundtouch/source/SoundTouch/BPMDetect.cpp soundtouch/source/SoundTouch/PeakFinder.cpp 

# for native audio 
LOCAL_LDLIBS += -lgcc 
LOCAL_C_INCLUDES += $(LOCAL_PATH)/soundtouch/include 
# --whole-archive -lgcc 
# for logging 
LOCAL_LDLIBS += -llog 
# for native asset manager 
#LOCAL_LDLIBS += -landroid 
# don't export all symbols 
# added "-marm" switch to use arm instruction set instead of thumb for improved calculation performance. 
LOCAL_CFLAGS += -Wall -fvisibility=hidden -I soundtouch/source/../include -D ST_NO_EXCEPTION_HANDLING -fdata-sections -ffunction-sections -marm 

include $(BUILD_SHARED_LIBRARY) 

Мои C++ General - Дорожки и символы включает в себя:

D:\android-ndk-r9c\sources\cxx-stl\gnu-libstdc++\4.8\include 
D:\android-ndk-r9c\sources\cxx-stl\gnu-libstdc++\4.8\libs\armeabi-v7a\include 
D:\android-ndk-r9c\platforms\android-8\arch-arm\usr\include 

Как я могу иметь эти правильные заявления не генерируют ошибку для целей подсветки синтаксиса?

ответ

Смежные вопросы