Frequently asked questions in Linux compilation

Source: Internet
Author: User

frequently asked questions in Linux compilation

Error TIP: makefile:2: * * * missing delimiter. Stop it.
Reason makefile missing a tab separator before GCC statement

Error hint: bash:./makefile: Insufficient permissions
The reason makefile is that the text file is not executable, even if it is root, it will not have enough permissions
We should use make at the command line, which will automatically search for the makefile file in the directory, and if you use a different name such as (makefile.am), you should add parameters, such as: Make-f makefile.am

Error message: A.c:6: Error: There is a free ' \200 ' in the program
A.c:6: Error: There is a free ' \200 ' in the program
A.c:8: Error: There is a free ' \343 ' in the program
A.c:8: Error: There is a free ' \200 ' in the program
A.c:8: Error: There is a free ' \200 ' in the program

Reason
This error is generally due to the use of Chinese punctuation in your program (A.C), such as,},+.
You can change it into English.
Even sometimes the space will appear similar error, delete the space to re-enter.
If you can't find it, the solution is to close the Chinese input method and then knock the wrong line again.

Error message:
0 Warning: Implicit declaration is incompatible with the built-in function ' printf '
1 Warning: Implicit declaration is incompatible with the built-in function ' malloc '
2 Warning: Implicit declaration is incompatible with the built-in function ' exit '
3 Warning: Implicit declaration is incompatible with the built-in function ' EXECLP '
4 Warning: Implicit declaration is incompatible with the built-in function ' strlen '
5 error: ' FILE ' is not declared (//using fopen)

Workaround:
Plus header file
0#include "Stdio.h"
1#include <malloc.h>
2#include <stdlib.h>
3#include <unistd.h>
4#include <string.h>
5#include <stdio.h>

The C-type string is followed by a ' + ' as the end-identifier implicitly added.
sizeof (a) includes the '
and Strlen (a) did not count ' to '.

Error: ' O_rdonly ' not declared
SOURCE FD = open ("Test.file", o_rdonly);
Solve:
#include <fcntl.h>
int open (const char *pathname, int oflag, .../* mode_t mode */);
Syntax Reference: http://baike.baidu.com/view/26337.htm
Different from:
#include <stdio.h>
FILE * fopen (const char * path,const char * mode);
Syntax Reference: http://baike.baidu.com/view/656681.htm

Error: ' CLONE_VM ' not declared
Error: ' Clone_files ' not declared
Source: Clone when using Clone (Do_something, Child_stack, clone_vm| Clone_files, NULL);
Solution: #include <sched.h>

Error: ' pid_t ' not declared
Source:/* Define child process number */pid_t pid;
Solve:
#include <stdlib.h>

Error: ' Options ' storage size is unknown
Source: Union Semun options; Http://dev.yesky.com/199/7643199_1.shtml
Cause: Semun definition Issues
Defined in/usr/include/linux/ipc.h
But there's no/usr/include/sys/ipc.h.
And usually the program will contain sys/ipc.h sys/sem.h impossible to contain linux/ipc.h, linux/sem.h, otherwise impossible to pass under Unix
Solve:
Union Semun {
int Val;
struct Semid_ds *buf;
UShort *array;
}arg;

Frequently asked questions in Linux compilation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.