Thread: A question on 'gcc'

  1. #1
    Registered User
    Join Date
    Oct 2010

    A question on 'gcc'

    Hi, everyone!

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

    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:

    gcc somecode.c
    Thanks in advance!

  2. #2

  3. #3
    Registered User claudiu's Avatar
    Join Date
    Feb 2010
    London, United Kingdom
    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, 02: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, 11:36 PM