Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, I'm trying to include a bunch of header files from the /usr/local/include directory that have the same name as header files in /usr/src/$(shell uname -r)/include. As far as I ...
  1. #1
    Just Joined!
    Join Date
    Jun 2011
    Posts
    1

    Including files from wrong directory

    Hi,

    I'm trying to include a bunch of header files from the /usr/local/include directory that have the same name as header files in /usr/src/$(shell uname -r)/include. As far as I can tell, the (uname) directory is getting searched first (when I want the local directory searched first). In a makefile, I've tried using
    obj-m += file1.o file2.o

    EXTRA_CFLAGS = -nostdinc
    EXTRA_CFLAGS += -I/usr/local/include
    all:
    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

    as well as some other variants on the above. Could someone give me some advice to make sure the local directory gets searched first or, minimally, to see where I'm including each file from?

  2. #2
    Linux Guru sdousley's Avatar
    Join Date
    Feb 2004
    Posts
    1,789
    can you not speify a full path to the include files?

    If not, I'd suggest looking in the PATH variable, and maybe altering the order of things, so that /usr/local/include comes before "."
    "I am not an alcoholic, alcoholics go to meetings"
    Registered Linux user = #372327

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...