Skip to content
Advertisement

Error “undefined reference to `cprintf”” during executing make command in qemu in linux kernel

(1) This is the main function (runproctest.c):

JavaScript

(2) defs.h:

JavaScript

(3) console.c

JavaScript

(4) main.c

JavaScript

(5) Here is my Makefile:

JavaScript

and when I enter make qemu there is a problem:

JavaScript

I don’t know why this happens..

Advertisement

Answer

in the makefile, this line:

JavaScript

should be:

JavaScript

There may be other ld commands in the make file with similar problems.

Also, per the error messages, there is no main() function anywhere in the files used to create the _runproctest executable. That is (usually) a strong indication that the code will not properly execute.

As an aside:

a name that begins with __ or _ followed by a capital letter are reserved for the environment.

Naming your own items with a leading underscore (probably) will work, but it is cluttering the environment name space. Strongly suggest not using any leading _ in your names

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement