Thread: error

  1. #1
    Registered User
    Join Date
    Apr 2003
    Posts
    6

    Unhappy error

    Hi guys,

    I've got a strange error coming up.......

    Particularly,

    [Warning] In function 'main'
    [Link error] undefined reference to 'show_menu'

    What does the above error mean?
    I've been trying to fix it but with no such luck....

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    This means that you've try to use a function called show_menu, but the source for that function is not available to the linker. Did you spell it correctly (including case)?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    6

    spelling's ok...

    Spelling is good, as weel as the inclusion of the case.

    How do I check if its included in the linker? Which part are we talking about here?

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    If the source is in another file, you need to link differently:

    >>cc file1.c file2.c

    There are examples of using multiple source files in these forums, try a search if you want to see an example.

    Post an example of the basic structure of your files if you get stuck, and someone will help you.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #5
    Registered User
    Join Date
    Apr 2003
    Posts
    6
    But, the only problem is i'm not using another file...
    I'm not linking this to another file..

    What other reason could it possibly be?

  6. #6
    Registered User Vber's Avatar
    Join Date
    Nov 2002
    Posts
    807
    Your function is not defined, maybe you just inserted the prototype, but the function it'self you didn't create.

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. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  4. Connecting to a mysql server and querying problem
    By Diod in forum C++ Programming
    Replies: 8
    Last Post: 02-13-2006, 10:33 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 01:10 AM