0

I am trying to compile a device driver for my target platform which is Snapdragon msm8974. I added some more code to an already tested module; and added more header files. One of the header files was not in my include directory, so I searched in my environment and found a number of options so I chose

~/android/android-ndk-r10d/platforms/android-19/arch-arm/usr/include/stdint.h

But I keep getting the following error, and do not know how to go about fixing it. Any advice on what I can do differently is greatly appreciated. Here is the error:

include/linux/stdint.h:32:24: fatal error: sys/_types.h: No such file or directory
compilation terminated.

Here is all my include statements in the file:

#include <inttypes.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <stdlib.h>
user3326293
  • 817
  • 1
  • 14
  • 37
  • How do you include the file? What syntax do you use? – bpgeck Aug 16 '15 at 16:28
  • @ bpgeck- #include . I added another one successfully; this one is giving me problems. The other include statement was #include – user3326293 Aug 16 '15 at 16:36
  • Does your path variable include that directory? – bpgeck Aug 16 '15 at 16:38
  • @bpgeck - yes. There are a number of header files in linux directory which are used by this program. – user3326293 Aug 16 '15 at 16:39
  • 1
    As `stdint.h` is part of the C compiler implementation, there should be a default path already. **That is no part of the OS**! – too honest for this site Aug 16 '15 at 16:42
  • 1
    Have you tried including `stdint.h` in the standard way `#include `? – bpgeck Aug 16 '15 at 16:42
  • @Olaf- I am using ndk. I got an error earlier asking for the stdint.h file. Regardless, if the default was sufficient for the file, it would also be the case for the file's requirements.Anyhow, I am not trying to do what is already in place. Should I remove stdint.h and post the error I got earlier? – user3326293 Aug 16 '15 at 16:44
  • @bpgeck - Re: standard way of including #include . No. I'll try it. Just so I am clear, you suggest I move the same file to the immediate directory where my code it and add the include file? – user3326293 Aug 16 '15 at 16:49
  • 1
    No, do not move around header files, which had not created my yourself. This would mess up everything. – alk Aug 16 '15 at 16:52
  • @alk - ok. I just need the right header file for implementing a buffer print. I got the idea from http://stackoverflow.com/questions/12120426/how-to-print-uint32-t-and-uint16-t-variables-value . One of the two header files recommended in that post required the stdint.h. – user3326293 Aug 16 '15 at 16:55
  • @user3326293 For native libraries you really should not move around the header files – bpgeck Aug 16 '15 at 17:00
  • @ bpgeck - Got it. But how do I accomplish what I need to do? – user3326293 Aug 16 '15 at 17:02
  • It still is not clear (to me at least) if you tried `#include ` and if, what errors you got. – alk Aug 16 '15 at 17:02
  • @bpgeck - I have tried that. I don't have the error in the buffer. I'll try it again and post the result. I'll post in about 30 minutes, as it takes that long for my script to clean the build environment, reconfig, and build. Thanks. – user3326293 Aug 16 '15 at 17:06
  • I now get the following error: /home/sansari/mytree2/tools/arm-eabi-4.7/bin/../lib/gcc/arm-eabi/4.7/include/stdint.h:3:26: error: no include path in which to search for stdint.h. I also get: include/linux/inttypes.h:23:23: fatal error: sys/cdefs.h: No such file or directory compilation terminated. – user3326293 Aug 16 '15 at 18:41

0 Answers0