Include problems

This is a discussion on Include problems within the C Programming forums, part of the General Programming Boards category; Im having some problems with my includes. I tried to stop using relative paths in my includes. I set the ...

  1. #1
    Registered User
    Join Date
    Jul 2002
    Posts
    913

    Include problems

    Im having some problems with my includes. I tried to stop using relative paths in my includes. I set the 'CPATH' and 'C_INCULDE_PATH' to '/home/martin/libraries/'. I can echo both and get back '/home/martin/libraries/'.

    In my home folder under libraries are more files with source code, headers, object files and a library.

    Now when ever i tried to include '<strings/str_copy.h>' I get a underfined reference error(for str_copy, a function in str_copy.c/h).

    It worked before(with others), but not now. Why? It has to atleast get the prototype right? Why am I even getting these errors?

  2. #2
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    I just noticed that every time it worked was when i was working in the sam directory.

    Is there a variable I can change so it looks for the object file with the includes name? Is there a 'automated' way of doing this?

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    26

    Wink help is here

    Well, you might want to start by lowering your big @$$ ego, I don't think a newbie should be so pridefull.
    "Borland Rocks!"

  4. #4
    Registered User
    Join Date
    Jul 2002
    Posts
    913
    Well, you might want to start by lowering your big @$$ ego,
    I want correct usefull code, not something that just compiles.........



    where are all gurus? is every one leaving?

  5. #5
    Been here, done that.
    Join Date
    May 2003
    Posts
    1,157

    Re: help is here

    Originally posted by nold
    Well, you might want to start by lowering your big @$$ ego, I don't think a newbie should be so pridefull.
    What are you referring to? That he has a directory with his name on it? And as far as a newbie, 659 posts to your 14? Who's the newbie? Sheesh, answer his question and leave your ego out of it.

    mart_man00,
    What OS (linux I assume)
    What compiler
    Why would you want to hardcode absolute paths instead of relative paths -- relative are so much more portable.
    Definition: Politics -- Latin, from
    poly meaning many and
    tics meaning blood sucking parasites
    -- Tom Smothers

  6. #6
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    It is best to leave all the standard libraries in the directories they were installed to. But under your options you should be able to change the path to the standard libraries as well as your user libraries.

    I would consult the docs for your compiler to see if it covers this.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C programing doubt
    By sivasankari in forum C Programming
    Replies: 2
    Last Post: 04-29-2008, 09:19 AM
  2. some problems with #include
    By Cmaniac in forum C Programming
    Replies: 6
    Last Post: 04-15-2007, 11:28 PM
  3. Headers that use each other
    By nickname_changed in forum C++ Programming
    Replies: 7
    Last Post: 10-03-2003, 04:25 AM
  4. #Include "class" problems
    By Unregistered in forum C++ Programming
    Replies: 17
    Last Post: 11-26-2001, 09:40 AM

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