About 2,160,000 results
Open links in new tab
  1. How to compile a C program in gcc which has header files?

    Dec 8, 2011 · I want to compile a C program in gcc which has my 2 header files. I am using the command: gcc UDP_Receive.c -o UDP_Receive -lm to compile it but I get an error stating …

  2. 12. Compiling, linking, Makefile, header files

    A common convention in C programs is to write a header file (with .h suffix) for each source file (.c suffix) that you link to your main source code. The logic is that the .c source file contains all of …

  3. Multiple Source Files in C - GeeksforGeeks

    Apr 26, 2025 · Methods to compile multi-file c program are given below: There are two methods to use two or more source code files in C as mentioned below: 1. Using as a Header file. After …

  4. GCC: Four Methods to Include Header File For Better Portability

    Method 2: Define a header file name. According to the C standard (C99 6.10.2#4), the following construct is totally legit: #define USE_HEADER "foo.h" #include USE_HEADER. So, we can …

  5. Compiling a C program using GCC - OpenGenus IQ

    In this article, we have covered how to compile a C program using the GCC compiler along with the different stages such as Preprocessing, compiling, assembling and linking.

  6. Header Files (The C Preprocessor) - GCC, the GNU Compiler

    A header file is a file containing C declarations and macro definitions (see Macros) to be shared between several source files. You request the use of a header file in your program by including …

  7. Compiling C Programs with GCC - Stanford University

    Note that you do not put header files (.h) into the gcc command: it reads in the header files as it compiles, based on the #include statements inside .c files. If the program compiled without …

  8. How can I compile a header file and a C file together?

    Mar 17, 2018 · It is possible to precompile your header files, but you only need precompiled headers in particular cases. More information here. If file.h is not in the same folder as file.c , …

  9. Compiling C files with gcc, step by step | by Laura Roudge

    Feb 6, 2019 · In this article, we will cover what the C language is, how to compile it with a tool like gcc, and what happens when we compile it. All the softwares, programs, websites and apps are...

  10. How to Compile a C Program Using the GNU Compiler (GCC) - wikiHow

    Feb 8, 2025 · On Windows 10 and 11, you can use GCC in a Windows Subsystem for Linux (WSL) shell, or by installing an open source tool called MinGW. This wikiHow guide will teach …

  11. Some results have been removed
Refresh