Hours of tinkering and I am still stuck, The problem seems to be that in dirent.h on the NDK, that DIR is not set to something the juce_linux_CommonFile.cpp can compile. It is "typdef struct DIR DIR;" which seem ambiguous and the calls to opendir also complain of being defined in another scope. There might be a namespace problem. I am running juce tip (3.0+) on a mac OSx 10.7 have latest Android SDK and NDK loaded with eclipse and ADT. Building other projects fine not Juce related. This is Introjucer created project and compiles on iOS and Windows VS2012 fine. I am using NDK version 14 and SDK 4.0
Here is the error:
/Users/shannon/Development/android-ndk-r9b/ndk-build all
[armeabi] Compile++ arm : juce_jni <= juce_core.cpp
In file included from jni/../../../../../thirdparty/juce/modules/juce_core/juce_core.cpp:210:0:
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp:136:5: error: 'DIR' does not name a type
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp: In constructor 'juce::DirectoryIterator::NativeIterator::Pimpl::Pimpl(const juce::File&, const juce::String&)':
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp:89:26: error: class 'juce::DirectoryIterator::NativeIterator::Pimpl' does not have any field named 'dir'
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp:89:77: error: 'opendir' was not declared in this scope
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp: In destructor 'juce::DirectoryIterator::NativeIterator::Pimpl::~Pimpl()':
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp:95:13: error: 'dir' was not declared in this scope
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp:96:26: error: 'closedir' was not declared in this scope
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp: In member function 'bool juce::DirectoryIterator::NativeIterator::Pimpl::next(juce::String&, bool*, bool*, juce::int64*, juce::Time*, juce::Time*, bool*)':
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp:103:13: error: 'dir' was not declared in this scope
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp:109:55: error: 'readdir' was not declared in this scope
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp:117:46: error: invalid use of incomplete type 'struct juce::DirectoryIterator::NativeIterator::Pimpl::next(juce::String&, bool*, bool*, juce::int64*, juce::Time*, juce::Time*, bool*)::dirent'
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp:109:24: error: forward declaration of 'struct juce::DirectoryIterator::NativeIterator::Pimpl::next(juce::String&, bool*, bool*, juce::int64*, juce::Time*, juce::Time*, bool*)::dirent'
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp:119:57: error: invalid use of incomplete type 'struct juce::DirectoryIterator::NativeIterator::Pimpl::next(juce::String&, bool*, bool*, juce::int64*, juce::Time*, juce::Time*, bool*)::dirent'
jni/../../../../../thirdparty/juce/modules/juce_core/native/juce_linux_CommonFile.cpp:109:24: error: forward declaration of 'struct juce::DirectoryIterator::NativeIterator::Pimpl::next(juce::String&, bool*, bool*, juce::int64*, juce::Time*, juce::Time*, bool*)::dirent'
make: *** [obj/local/armeabi/objs/juce_jni/__/__/__/__/__/thirdparty/juce/modules/juce_core/juce_core.o] Error 1
Any ideas on how to fix this greatly appreciated,
Thanks, Shannon