0

I've read all the other posts involving STL libraries and the Android NDK with Eclipse, but I am still having this problem in my JNI file:

#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() is syntax highlighted in both instances with the following error message:

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(?)
'

Nothing else is highlighted. The library builds fine. The same result with a built in data type, such as vector<int>.

With:

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

I get memcpy highlighted with the following message:

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

Here is Application.mk:

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

and 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)

My C++ General - Paths and Symbols includes:

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

How can I have these correct statements not generate an error for the purposes of syntax highlighting?

Steve M
  • 9,296
  • 11
  • 49
  • 98

1 Answers1

1

This might help:

c++ eclipse wrong error interpretation

Looks like an Eclipse CDT bug. Report it?

http://www.eclipse.org/cdt/support.php

Community
  • 1
  • 1
Dannie
  • 2,430
  • 14
  • 16