'sigset_t' and pthread.h

339 views
Skip to first unread message

rohit wali

unread,
Mar 11, 2014, 10:33:53 AM3/11/14
to andro...@googlegroups.com
Hi,

I am using <string> in my native C++ code and I am getting the following error while compiling
In file included from {NDK_ROOT}/sources/cxx-stl/stlport/stlport/pthread.h:29:0,
                 from jni/{where_my_header_is}/myheader.h:x,
                 from jni/{where_my_header_is}/Myclass.cpp:y:
{NDK_ROOT}/platforms/android-16/arch-arm/usr/include/../include/pthread.h:271:36: error: 'sigset_t' does not name a type
{NDK_ROOT}/platforms/android-16/arch-arm/usr/include/../include/pthread.h:271:46: error: ISO C++ forbids declaration of 'set' with no type [-fpermissive]
{NDK_ROOT}/platforms/android-16/arch-arm/usr/include/../include/pthread.h:271:51: error: 'sigset_t' has not been declared

Any help would be appreciated.


Thanks,
Rohit

David Turner

unread,
Mar 11, 2014, 5:19:02 PM3/11/14
to andro...@googlegroups.com
Try including <signal.h> before <pthread.h>, it looks like there is a bug in the latter header though.


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/d/optout.

Jeffrey Walton

unread,
Mar 11, 2014, 5:38:27 PM3/11/14
to Android NDK List

Jeffrey Walton

unread,
Mar 11, 2014, 6:11:47 PM3/11/14
to Android NDK List
On Tue, Mar 11, 2014 at 10:33 AM, rohit wali <rohit....@gmail.com> wrote:
Sorry, I did not see David answered this.

You'll get these issues on Linux too, so I believe Android inherited
them. I seem to recall experiencing it with some of the networking
headers, and not the signal stuff.

When you encounter it, re-arrange the order of your C++ includes and
your system includes (either C++ headers first or system headers
first).

Looking at a Linux C++ project that includes them, I have the C
headers first, then the system headers, and finally the C++ headers.

Sorry I don't recall more details. Its been a couple of years since I
experienced it.

Jeff
Reply all
Reply to author
Forward
0 new messages