【发布时间】:2013-08-04 06:46:26
【问题描述】:
即使是这样的简单代码也会出现错误
string test= "hello";
string part = test.substr(2, 3);
无效参数候选者是:stlpmtx_std::basic_string,stlpmtx_std::allocator> substr(?, ?)
即使转换为 size_t 也无济于事 字符串部分 = test.substr((size_t)2, (size_t)3);
但是,当在 Linux 上使用 gcc 4.6 作为控制台应用程序运行时,这两条代码都可以正常工作。 但是当使用 Androind NDK 时,它给了我错误。
如果我在编辑器中关闭文件并关闭 Eclipse,然后打开 Eclipse 并构建它编译的项目。但是如果我打开文件,它会抛出错误。
我在 Application.mk 生成文件中使用 APP_STL:= stlport_static
是的,我确实包含了
编辑:我只是查看了 .so 文件的时间,即使 Eclipse 显示错误,它似乎也在编译。
【问题讨论】:
-
您是否包含
<string>? -
是的,我确实包括了那个
标签: android c++ android-ndk substring eclipse-cdt