I'm trying to compile the android kernel which I have patched it with some application patch file, which have changed the kernel. here is the the compilation error:

androtrace/androtrace.c: In function 'androtrace_add_io': androtrace/androtrace.c:227:23: error: 'REQ_WRITE' undeclared (first use in this function) if (rq->cmd_flags & req_write) { /* write */

androtrace/androtrace.c:227:23: note: each undeclared identifier is reported only once for each function it appears in androtrace/androtrace.c:255:23: error: 'REQ_DISCARD' undeclared (first use in this function) if (rq->cmd_flags & REQ_DISCARD)

androtrace/androtrace.c:257:24: error: 'REQ_FLUSH' undeclared (first use in this function) if (rq->cmd_flags & REQ_FLUSH)

scripts/Makefile.build:293: recipe for target 'androtrace/androtrace.o' failed

make[1]: *** [androtrace/androtrace.o] Error 1

Makefile:1011: recipe for target 'androtrace' failed

make: *** [androtrace] Error 2

make: *** Waiting for unfinished jobs....

What to do with undeclared variables in a function, how to find where it is coming from?

  • Make sure that the patch applied cleanly and that you are using the correct version of the kernel sources (that which the patch was written for). Contact the provider of the patch for further information. – Kusalananda Aug 23 '18 at 8:19
  • @Kusalananda thanks for answer, Yes! version of the kernel which the patch was written for is different from the one I am working with, so what should I do now? – ati Aug 27 '18 at 0:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.