undefined reference

This is a discussion on undefined reference within the C Programming forums, part of the General Programming Boards category; This is my C code: int main(int argc, char **argv) { vec_t **x; PATTERN *pat; unsigned long num_patfiles, total_num_pats; pat ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    22

    undefined reference

    This is my C code:
    int main(int argc, char **argv)
    {
    vec_t **x;
    PATTERN *pat;
    unsigned long num_patfiles, total_num_pats;
    pat = (PATTERN *) get_pattern("faem0.test.pds", &num_patfiles,&total_num_pats);
    x = extract_patterns(pat, num_patfiles, total_num_pats);
    return(0);
    }

    After I compile it, two messages come out:
    1. undefined reference to 'get_pattern(char *, unsigned long *, unsigned long *)'
    2. undefined reference to 'extract_pattern(char *, unsigned long *, unsigned long *)'

    What is undefined reference? How can I solve this problem?

  2. #2
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807
    first of all, use code tags, second, where did you declare those functions? (get_pattern and so on...) the compiler don't recognize this functions, neither me, I'm quite sure they're not ANSI.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 11:45 AM
  3. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  4. C OpenGL Compiler Error?
    By Matt3000 in forum C Programming
    Replies: 12
    Last Post: 07-07-2006, 04:42 PM
  5. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 09:18 AM

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