#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    india
    Posts
    28
    Rep Power
    0

    c linking problem(patth problem)


    hello,
    in my application i am including header like

    #include<libxml/tree.h>


    and these really stored in
    /usr/include/libxml

    and my application is there
    /usr/local/app

    but i have set env variable as

    $PATH=$PATH:/usr/local/app

    my question is like this why it is not searching in env path
    if the app can't find in same folder
    it is telling like

    mnpmasi.c:25:25: libxml/tree.h: No such file or directory

    why
  2. #2
  3. Contributing User
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2003
    Location
    USA
    Posts
    7,242
    Rep Power
    2222
    The PATH environment variable only applies to executables.

    In your gcc command, include the option:
    -I/usr/include/libxml

    That will tell gcc to also search for header files in that directory.

    If that does not work, then since you give the libxml subdirectory in the #include statement, try :
    -I/usr/include

IMN logo majestic logo threadwatch logo seochat tools logo