A question on 'gcc'

This is a discussion on A question on 'gcc' within the C Programming forums, part of the General Programming Boards category; Hi, everyone! When I compile some source files, I have to always type: Code: gcc -I/somewhere/include -L/somewhere/lib somecode.c Is there ...

  1. #1
    Registered User
    Join Date
    Oct 2010
    Posts
    16

    A question on 'gcc'

    Hi, everyone!

    When I compile some source files, I have to always type:

    Code:
    gcc -I/somewhere/include -L/somewhere/lib somecode.c
    Is there any way that I can configure gcc so that '-I/somewhere/include -L/somewhere/lib' will be included automatically?

    If so, I only need to type:

    Code:
    gcc somecode.c
    Thanks in advance!

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,641

  3. #3
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    Location
    London, United Kingdom
    Posts
    2,094
    Why not set up a make file and then all you have to type is make.
    1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
    2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
    3. Get rid of conio.h and other antiquated DOS crap headers.
    4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling GNU MP
    By mattnp12 in forum C Programming
    Replies: 3
    Last Post: 06-23-2011, 03:58 PM
  2. gcc warning: implicit declaration of function
    By anatoly in forum C Programming
    Replies: 4
    Last Post: 05-02-2010, 04:32 PM
  3. question - linux - gcc - c standards
    By AMAMH in forum C Programming
    Replies: 12
    Last Post: 12-03-2009, 01:49 AM
  4. How to override standard printf defined in gcc library
    By RahulJain83 in forum C Programming
    Replies: 7
    Last Post: 10-27-2009, 09:23 PM
  5. Question about linux compiling with GCC
    By elsheepo in forum C++ Programming
    Replies: 23
    Last Post: 03-07-2008, 10:36 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21