stupid errors i got after compiling!! HELP ME!

This is a discussion on stupid errors i got after compiling!! HELP ME! within the C++ Programming forums, part of the General Programming Boards category; LEE11.OBJ : error LNK2001: unresolved external symbol "int __cdecl add(int,int)" (?add@@YAHHH@Z) Debug/LEE11.exe : fatal error LNK1120: 1 unresolved externals Error ...

  1. #1
    Unregistered Leeman_s's Avatar
    Join Date
    Oct 2001
    Posts
    753

    stupid errors i got after compiling!! HELP ME!

    LEE11.OBJ : error LNK2001: unresolved external symbol "int __cdecl add(int,int)" (?add@@YAHHH@Z)
    Debug/LEE11.exe : fatal error LNK1120: 1 unresolved externals
    Error executing link.exe.

    It was working, then im like "hmm...i'll compile this". I compiled it and now i get these 2 errors. what do i do?

  2. #2
    zen
    zen is offline
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    It looks as though you haven't defined your add function in your code. I'm gusiing your program should be something like -

    Code:
    int add(int a, int b);	//prototype
    
    int main() 
    { 
    	add(1,2);
    	return 0; 
    }
    
    
    int add(int a, int b)	//definition
    {
    	return a+b;
    }
    zen

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Quincy 2005: Compiling Errors
    By Thileepan_Bala in forum C Programming
    Replies: 6
    Last Post: 01-18-2008, 08:26 PM
  2. weird errors
    By alexnb185 in forum C Programming
    Replies: 4
    Last Post: 11-22-2007, 10:11 PM
  3. Ten Errors
    By AverageSoftware in forum Contests Board
    Replies: 0
    Last Post: 07-20-2007, 11:50 AM
  4. Compiling using g++ and getting errors...
    By alvifarooq in forum C++ Programming
    Replies: 2
    Last Post: 09-24-2004, 09:36 AM
  5. Errors compiling classes with VC++ 6.0
    By xErath in forum C++ Programming
    Replies: 2
    Last Post: 07-02-2004, 08:58 AM

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