Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6343873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:31:51+00:00 2026-05-24T20:31:51+00:00

I am writing a C program for use on the android command line. I

  • 0

I am writing a C program for use on the android command line. I haven’t had any issues compiling until I started using message queues and including linux/msg.h (or sys/msg.h). I am not sure what the right library to link to is or even how to do it with Android.mk. I have been through as many questions as possible and no answer has seemed to work.

The exact errors that I’m getting:

  • sys/msg.h: No such file or direcory
  • implicit declaration of function ‘msgget’
  • implicit declaration of function ‘msgsnd’
  • implicit declaration of function ‘msgrcv’
  • implicit declaration of function ‘msgctl’

Here is my Android.mk file:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)
LOCAL_SRC_FILES := appX.c 
LOCAL_MODULE := appX
LOCAL_MODULE_TAGS := optional
LOCAL_STATIC_LIBRARIES := libc
LOCAL_C_INCLUDES := $(LOCAL_PATH)
include $(BUILD_EXECUTABLE)

I really appreciate any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:31:52+00:00Added an answer on May 24, 2026 at 8:31 pm

    The NDK headers in $(NDK_ROOT)/platforms/android-[X]/usr/include are the only headers supported by the NDK. If you use other Android or Linux headers, your app is likely to break in the future.

    Why is this? Because most Android apps run in the Dalvik virtual machine and are insulated from the system by layers of Java framework classes, the Android authors can afford to be fairly cavalier about the underlying Linux system. They are free to change headers and libraries as often as they want, as long as they keep the Java layer compatible. The same goes for the NDK: as long as they don’t break the very limited set of headers and libraries that the NDK provides, they can change whatever they want to change under the hood.

    So by design the NDK make system does not make it easy to link to anything but the NDK libraries. If it made it easy to talk to random Linux headers, it would defeat the purpose of the NDK.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If you are writing a program that is executable from the command line, you
I'm writing a program in Python that accepts command line arguments. I am parsing
I'm new to android, and I'm writing a program use bluetooth, so I use
I'm writing a program which will use scan conversion on triangles to fill in
OK, so I am writing a program that unfortunately needs to use a huge
I am writing my first serious wxWidgets program. I'd like to use the wxConfig
I'm looking to use procedurally-generated sound and music in a Flash program I'm writing.
I'm writing a program (for Mac OS X, using Objective-C) and I need to
I am writing an iphone program which use facebook and twitter api.But I can't
i'm writing program for Nokia 5230 (S60 5th edition platform) using Nokia Qt SDK.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.