Android/NDK项目,一直使用NDK版本直至r8c。在8d和8e下,我在armeabi-v7a构建上收到编译错误消息:
Compile++ thumb : myproject <= MyFile.cpp
C:\cygwin\tmp\ccFXOc2F.s: Assembler messages:
C:\cygwin\tmp\ccFXOc2F.s:1935: Error: can't resolve `.data.rel.ro.local' {.data.rel.ro.local section} - `.LPIC44' {*UND* section}
obj
文件夹。LOCAL_CPPFLAGS := -fshort-wchar -fsigned-char -Wno-psabi
最佳答案
在我看来,这肯定是一个编译器错误。它与对大量静态const数据的索引访问有关。当我略微改写了一个完全无辜的声明时,错误消息消失了。
以前是:
//In global scope
static const LPCWSTR Comments[] = {L"A lot of strings here", L"String 2", L"String 3" /* and many more */ }:
void SomeMethod()
{
DoSomething(Comments[i]); //That was the offending line - commenting it out would get rid the error
}
void SomeMethod()
{
static LPCWSTR pComments = 0;
if(!pComments)
pComments = Comments;
DoSomething(pComments[i]); //Now it works.
}
关于android - NDK错误: “can' t resolve `.data.rel.ro.local' ”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15574587/
相关文章:
compiler-errors - JRE 抛出的 fatal error
qt - 无法运行编译qt应用程序。 Qt Creator忽略斜线
compiler-errors - 在NME中定位-演示项目无法转换为例如JavaScript-目标
compiler-errors - 这怎么了? Submit.CommandText = SQL?
scala - 斯卡拉(Scala),卡斯巴(Casbah): MongoCollection.in
java - Play Framework CompilationException