[SOLVED] What's the meaning of "undefined names"? see the details in the attached picture.
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What's the meaning of "undefined names"? see the details in the attached picture.
I can't understand the sentence :The C compiler uses a
predefined library of functions (the C library) that have the names of the system
calls, thus resolving the system call references in the user program to what would
otherwise be undefined names.
This is my understanding part of it: the c library has some functions that are with the same names of system calls but I can't understand the behind part of it. What's the meaning of "undefined names"? Does it mean system calls that don't have names?
I'm really sorry for if it is a problem of my english.
therefore, if you make a "system call", or otherwise, and there is nothing to reference it, (the function call) to, then logic states, it is undefined, and will tell you so. example
Code:
#include <stdio.h>
int main (void)
{
gofunny();
return 0;
}
// output
$ gcc udef.c
udef.c: In function ‘main’:
udef.c:9:1: warning: implicit declaration of function ‘gofunny’ [-Wimplicit-function-declaration]
gofunny();
^~~~~~~
/usr/bin/ld: /tmp/ccJfv1JF.o: in function `main':
udef.c:(.text+0xa): undefined reference to `gofunny'
collect2: error: ld returned 1 exit status
The header files are where the functions are defined. Keep reading...
It says, "The C library used by the compiler defines these system calls. If it did not they would be (otherwise) undefined."
It would be helpful when asking questions in the context of some external documentation, to include the name of that documentation or a link to the source so that others might better understand the context of the question.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.