Problems with Linux compiling C

Source: Internet
Author: User

1. #include "stdio.h" issue

In a 64-bit system, write a C program, using GCC, when compiling, there will be error:stdio.h: No that file, the workaround:

Install on the command line by entering sudo apt-get install build-essential

Reference: http://blog.csdn.net/yygydjkthh/article/details/41787049

2.warning:incompatible implicit declaration of built-in function ' printf '

Plus #inlcude "Stdio.h"

Warning:incompatible implicit declaration of built-in function ' strcpy '

Add # include "String.h"

Warning:incompatible implicit declaration of built-in function ' malloc '

Add # include "Stdlib.h"

3. Clone_vm,clone_sighand,clone_fs,clone_files not declared

Add # include "Linux/sched.h"

Reference: http://blog.csdn.net/vblittleboy/article/details/8052027

4. Undefined references to Sem_post, references to sem_wait undecided

I. See less head file:

#include "Pthread.h"

#include "semaphore.h"

II. Add-plthread at compile-time command

Problems with Linux compiling C

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.