And I have written some code for testing. I found that even some basic
C++ features are not support such as std::cout. Not even std::string
or STL.
But I find an article that gives a C++ sample code, in which std::cout
is used. It seems that it can run in emulator. Please refer
http://www.anddev.org/native_c_-und-quothello_world-und-quot_working_in_emulator-t61.html
The code is built with toolchain and with the -static option. It
sounds reasonable that link the static libraries that ndk doesn't
provided.
I want to know:
1. why NDK only supports that extremely minimal C++?
2. is the way mentioned above practicable? need to built with
toolchain? since headers and libraries not provided by NDK build
system.
3. is it possible that copy some header files to the include path for
use? since most template classes only have header files
anybody can explain something for me? thanks :-)
and i will also make some experiments. if any result, i will share
with you.
It will be appricated that any comments added :-)
On 3月8日, 下午5时45分, Hendy <hendy...@gmail.com> wrote:
> I have read about the NDK docs/STABLE-APIS.TXT and it is said that "An
> *extremely* minimal C++ support API is available".
>
> And I have written some code for testing. I found that even some basic
> C++ features are not support such as std::cout. Not even std::string
> or STL.
>
> But I find an article that gives a C++ sample code, in which std::cout
> is used. It seems that it can run in emulator. Please referhttp://www.anddev.org/native_c_-und-quothello_world-und-quot_working_...
I've rebuilt Android NDK 1.6 with minimal changes and have enabled
full C++ support (STL, exceptions, RTTI). C++ library links statically
to application. I've ported my engine with active usage of exceptions,
templates and STL to android and it works fine. Also, as I know, guys
from Ogre3D project (http://www.ogre3d.org/) using my custom
distribution to port theirs engine to android.
See http://www.crystax.net/androidndk.php for details. You can
download my custom builds or build own version following instructions
I've provided there.
Dmitry Moskalchuk
08.03.2010, в 12:55, Hendy написал(а):
> --
> You received this message because you are subscribed to the Google
> Groups "android-ndk" group.
> To post to this group, send email to andro...@googlegroups.com.
> To unsubscribe from this group, send email to android-ndk...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en
> .
>
On 3月8日, 下午8时46分, Dmitry Moskalchuk <crys...@gmail.com> wrote:
> Hi,
>
> I've rebuilt Android NDK 1.6 with minimal changes and have enabled
> full C++ support (STL, exceptions, RTTI). C++ library links statically
> to application. I've ported my engine with active usage of exceptions,
> templates and STL to android and it works fine. Also, as I know, guys
> from Ogre3D project (http://www.ogre3d.org/) using my custom
> distribution to port theirs engine to android.
> Seehttp://www.crystax.net/androidndk.phpfor details. You can
> > .- 隐藏被引用文字 -
>
> - 显示引用的文字 -
Thank you very much :-)
On 3月8日, 下午8时46分, Dmitry Moskalchuk <crys...@gmail.com> wrote:
> Hi,
>
> I've rebuilt Android NDK 1.6 with minimal changes and have enabled
> full C++ support (STL, exceptions, RTTI). C++ library links statically
> to application. I've ported my engine with active usage of exceptions,
> templates and STL to android and it works fine. Also, as I know, guys
> from Ogre3D project (http://www.ogre3d.org/) using my custom
> distribution to port theirs engine to android.
> Seehttp://www.crystax.net/androidndk.phpfor details. You can
Hi,
I see that there is quite some work about Stl for Android. You may
have seen that an Android patch has just been integrated in the
STLport repository:
- the patch:
http://sourceforge.net/tracker/?func=detail&aid=2943782&group_id=146814&atid=766246
- the source in the 5.2 branch:
http://stlport.git.sourceforge.net/git/gitweb.cgi?p=stlport/stlport;a=shortlog;h=refs/heads/STLport-5.2
- the discussion:
http://sourceforge.net/projects/stlport/forums/forum/490892/topic/3393072
That good news! For just Stl support, this can avoid us to need the
customized Ndk (which is tagged as experimental at this time).
The bad new though is that the Android port may not be kept in the
STLport code if nobody takes care of it. Any developer like me can
give some help to compile and run the tests. However, when a problem
occurs (with new Ndk or STLport versions), we may additionally need
some help from people who have some knowledge of STL and/or Android
internals.
Conclusion: at this time Stl support in the Ndk remains a future plan,
so in the meantime, what about joining the STLport developers?
Emmanuel
Thanks and regards,
KKK.
> >> On Wed, Mar 10, 2010 at 11:39 AM, Dmitry Moskalchuk <crys...@gmail.com>wrote:
>
> >>> Yes, it was hard to believe to me too. But note that there is internal
> >>> development policy in google - they don't use stl and exceptions. Therefore
> >>> it just a dead weight for them. See also my discussion with David Turner -
> >>>http://groups.google.com/group/android-ndk/browse_thread/thread/89db6...
>
> >>> Dmitry Moskalchuk
>
> >>> 10.03.2010, в 22:28, Gregory Ray написал(а):
>
> >>> I will try out your solution. I am extremely skeptical the framework team
> >>> threw out stl support only because of binary size, that seems irrational to
> >>> me seeing how standard stl is. I'd love feedback from Fadden or Dianne on
> >>> this.
>
> >>> On Wed, Mar 10, 2010 at 11:04 AM, Dmitry Moskalchuk <crys...@gmail.com>wrote:
>
> >>>> Setting --enable-libstdc__-v3 I've just informing build system that I
> >>>> need to build libstdc++ and libsupc++ from GCC. Then android version of
> >>>> libstdc++ replaced by GCC's one (see my patch, there are lines doing that).
> >>>> GCC already support ARM platform and do it well so the only reason to throw
> >>>> away it's libstdc++ and replace by own (as it was done by android team) is
> >>>> size of final binary.
>
> >>>> Dmitry Moskalchuk
>
> >>>> 10.03.2010, в 21:51, Gregory Ray написал(а):
>
> >>>> So the apk that is created includes the libstdc++ static library?
> >>>> There's nothing wrong with that, the stlport has to be included as well.
> >>>> Does that all happen by just setting -enable-libstc__-v3, seems like you
> >>>> would need at minimum to modify your Android.mk and include the static
> >>>> library in your libs folder.
>
> >>>> 2010/3/10 Dmitry Moskalchuk <crys...@gmail.com>
>
> >>>>> It's very simple - libstdc++ links statically. Therefore it does not
> >>>>> need any runtime support from android system but existing. The only drawback
> >>>>> is bit bigger size of final binary. But that's not problem for me - instead
> >>>>> I have the same code compiling well on Linux, Mac OS X, iPhone and Android.
>
> >>>>> Dmitry Moskalchuk
>
> >>>>> 10.03.2010, в 21:28, Gregory Ray написал(а):
>
> >>>>> I guess what I am wondering is, your local dev environment is compiled
> >>>>> with stl support on, but will out-of-the-box phones have that support
> >>>>> enabled by default? I'm just trying to understand how this is working
> >>>>> because it seems allot better than the stlport solution but I don't grasp
> >>>>> how the stl libraries are packaged in a manner that can be distributed.
>
> >>>>> 2010/3/10 Dmitry Moskalchuk <crys...@gmail.com>
>
> >>>>>> Yes, I've ported my engine (~50 KLoc) to android. There is active
> >>>>>> usage of exceptions, templates and rtti. But I have not yet finished my
> >>>>>> application (which use that engine) so it's not on the android market yet).
>
> >>>>>> Dmitry Moskalchuk
>
> >>>>>> 10.03.2010, в 21:12, Gregory Ray написал(а):
>
> >>>>>> Have you created an app using this process and tested it on the
> >>>>>> android market?
>
> >>>>>> On Wed, Mar 10, 2010 at 9:47 AM, Dmitry Moskalchuk <crys...@gmail.com
> >>>>>> > wrote:
>
> >>>>>>> No, it's exclusively my work. Actually I was started doing that after
> >>>>>>> discussion with Martins Mozeiko (
> >>>>>>>http://groups.google.com/group/android-ndk/msg/833130aaf0a3cd7e).
> >>>>>>> That was good point to know that somebody have it done. So I've started
> >>>>>>> investigation and, after number of iterations, got it fully working.
>
> >>>>>>> Dmitry Moskalchuk
>
> >>>>>>> 10.03.2010, в 20:30, Gregory Ray написал(а):
>
> >>>>>>> Dmitry,
>
> >>>>>>> Is your custom distribution based on John Ripley NDK Wrapper scripts?
>
> >>>>>>> 2010/3/8 Dmitry Moskalchuk <crys...@gmail.com>
>
> >>>>>>>> Hi,
>
> >>>>>>>> I've rebuilt Android NDK 1.6 with minimal changes and have enabled
> >>>>>>>> full C++ support (STL, exceptions, RTTI). C++ library links statically to
> >>>>>>>> application. I've ported my engine with active usage of exceptions,
> >>>>>>>> templates and STL to android and it works fine. Also, as I know, guys from
> >>>>>>>> Ogre3D project (http://www.ogre3d.org/) using my custom
> >>>>>>>> distribution to port theirs engine to android.
> >>>>>>>> Seehttp://www.crystax.net/androidndk.phpfor details. You can
> >>>>>>>>> android-ndk...@googlegroups.com<android-ndk%2Bunsubscribe@googlegr oups.com>
> >>>>>>>>> .
> >>>>>>>>> For more options, visit this group at
> >>>>>>>>>http://groups.google.com/group/android-ndk?hl=en.
>
> >>>>>>>> --
> >>>>>>>> You received this message because you are subscribed to the Google
> >>>>>>>> Groups "android-ndk" group.
> >>>>>>>> To post to this group, send email to andro...@googlegroups.com.
> >>>>>>>> To unsubscribe from this group, send email to
> >>>>>>>> android-ndk...@googlegroups.com<android-ndk%2Bunsubscribe@googlegr oups.com>
> >>>>>>>> .
> >>>>>>>> For more options, visit this group at
> >>>>>>>>http://groups.google.com/group/android-ndk?hl=en.
>
> >>>>>>> --
> >>>>>>> Gregory Ray
> >>>>>>> COO, Seek Mobile Interactive, Inc.
>
> >>>>>>> ---
>
> >>>>>>> This e-mail message, including any attachments, is for the sole use
> >>>>>>> of the intended recipient(s) and may contain information that is
> >>>>>>> confidential and protected by law from unauthorized disclosure. Any
> >>>>>>> unauthorized review, use, disclosure or distribution is prohibited. If you
> >>>>>>> are not the intended recipient, please contact the sender by reply e-mail
> >>>>>>> and destroy all copies of the original message.
>
> >>>>>>> --
> >>>>>>> You received this message because you are subscribed to the Google
> >>>>>>> Groups "android-ndk" group.
> >>>>>>> To post to this group, send email to andro...@googlegroups.com.
> >>>>>>> To unsubscribe from this group, send email to
> >>>>>>> android-ndk...@googlegroups.com.
> >>>>>>> For more options, visit this group at
> >>>>>>>http://groups.google.com/group/android-ndk?hl=en.
>
> >>>>>>> --
> >>>>>>> You received this message because you are
>
> ...
>
> read more >>
Emmanuel
Any advice from people knowing Stl or Android is welcome, thanks!
Emmanuel
On Mar 11, 11:07 am, Emmanuel <etiev...@altern.org> wrote:
> Android patch in STLport
>
> I see that there is quite some work aboutStlfor Android. You may
> have seen that an Android patch has just been integrated in the
> STLport repository:
> - the patch:http://sourceforge.net/tracker/?func=detail&aid=2943782&group_id=1468...
> - the source in the 5.2 branch:http://stlport.git.sourceforge.net/git/gitweb.cgi?p=stlport/stlport;a...
> - the discussion:http://sourceforge.net/projects/stlport/forums/forum/490892/topic/339...
>
> That good news! For justStlsupport, this can avoid us to need the
> customized Ndk (which is tagged as experimental at this time).
>
> The bad new though is that the Android port may not be kept in the
> STLport code if nobody takes care of it. Any developer like me can
> give some help to compile and run the tests. However, when a problem
> occurs (with new Ndk or STLport versions), we may additionally need
> some help from people who have some knowledge of STL and/or Android
> internals.
>
> Conclusion: at this timeStlsupport in the Ndk remains a future plan,
I compiled STLport statically (because LD_LIBRARY_PATH not used on
Android and /system/lib readonly). I did:
./configure --target=android
SYSROOT=/opt/android-ndk/build/platforms/android-4/arch-arm/ make -C
build/lib stldbg-static dbg-static release-static
To use it in a shared library, I added in Android.mk:
STLPORT_INC := ...
STLPORT_LIB := ...
LOCAL_CFLAGS += -I$(STLPORT_INC) \
-D__NEW__ \
-D__SGI_STL_INTERNAL_PAIR_H \
-DANDROID \
-DOS_ANDROID \
-D_STLP_NO_CWCHAR
# wchar: already in android
LOCAL_CFLAGS += -D__ANDROID__ \
-isystem build/platforms/android-4/arch-arm/usr/include
LOCAL_STATIC_LIBRARIES := \
-L$(STLPORT_LIB) -lstlport
# beware not to have the libstlport.so in the lib path
Emmanuel
Emmanuel
Are you invoking the `./configure` command in the source root
directory? When I tried your command, I get: "Unknown configuration
option SYSROOT='...'"
`make -C build/lib stldbg-static dbg-static release-static`
The copy of source I have is a snapshot from the link you posted. I
noticed the directory hierarchy in this snapshot is different than the
package posted on stlport.org, and the source you have. For example,
there's no `build` directory under the source root. What is the proper
way for obtaining the Android patched stlport source?
Thanks!
On Mar 18, 11:30 am, Emmanuel <etiev...@altern.org> wrote:
> Oups, in fact static linking is not an option forSTLport.
> I started a new topic to discuss compilation and testing ofSTLport:http://groups.google.com/group/android-ndk/browse_thread/thread/5d419...
>
> Emmanuel
In there, I have a stlport directory containing src, configure,
build, ...
You may have to run
SYSROOT=/opt/android-ndk/build/platforms/android-4/arch-arm/ make
before, without -C (as I did when trying), to create the build
directory...?
By the way, about static linking (dangerous in general for STLport),
you can see:
http://sourceforge.net/tracker/?func=detail&aid=2972060&group_id=146814&atid=766244
(For dynamic linking, I get a sigill signal at runtime for now:
unknown instruction...).
Emmanuel
In there, I have a stlport directory containing src, configure,
build, ...
You may have to run
SYSROOT=/opt/android-ndk/build/platforms/android-4/arch-arm/ make
before, without -C (as I did when trying), to create the build
directory...?
By the way, about static linking (dangerous in general for STLport),
you can see:
http://sourceforge.net/tracker/?func=detail&aid=2972060&group_id=146814&atid=766244
(For dynamic linking, I get a sigill signal at runtime for now:
unknown instruction...).
Emmanuel
On Mar 19, 9:45 pm, Jin Chiu <live2drea...@gmail.com> wrote:
1) first check out revision 2010-03-05 with git to some directory
2) set environment variable SYSROOT to one of appropriate android sdk/
arch path, where for me it would be typing "SYSROOT=/Users/
mike_vasiljevs/development/android/android-ndk-r3/build/platforms/
android-4/arch-arm" in the terminal
3) run configure with android as target "./configure --target=android"
4) run make in $STLPORTSOURCE/build/lib "cd $STLPORTSOURCE/build/lib;
make stldbg-static dbg-static release-static"
...to get a cross-compiled stl library.
recent version of stlport seems to have '$STLPORTSOURCE/build/
Makefiles/gmake/android' entry missing. Will try revision mentioned,
need to find out how to use git first...
best regards
mike
On Mar 23, 4:21 pm, Emmanuel <etiev...@altern.org> wrote:
> The snapshot I used: the first 2010-03-05 inhttp://stlport.git.sourceforge.net/git/gitweb.cgi?p=stlport/stlport;a...
>
> In there, I have a stlport directory containing src, configure,
> build, ...
>
> You may have to run
> SYSROOT=/opt/android-ndk/build/platforms/android-4/arch-arm/ make
> before, without -C (as I did when trying), to create the build
> directory...?
>
> By the way, about static linking (dangerous in general for STLport),
> you can see:http://sourceforge.net/tracker/?func=detail&aid=2972060&group_id=1468...
Many thanks
mike
On Apr 8, 1:11 pm, Emmanuel <etiev...@altern.org> wrote:
> Yes, I first meant that, for the static library. But now I got the
> dynamic library to work, and this avoid potentially BIG troubles.
> Please see now:http://groups.google.com/group/android-ndk/browse_thread/thread/5d419...