Thread: Multiple definitions error for all function definitions in header

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Programming Ninja In-T...
    Join Date
    May 2009
    Posts
    827

    Talking Multiple definitions error for all function definitions in header

    Ok, this is weird...
    My compiler is producing a "multiple definition" error for every single function definition inside a header file that I wrote. Each function definition is a member function of a class which is defined in the same file. I put the function definitions after the class definition.

    My header has include guards (i.e. #ifndef, #define, and #endif) wrapped around the whole code, and needless to say, I don't have any duplicated function definitions.

    Anyone have any idea why its doing this??

    Thanks in advance.

    EDIT: Another interesting thing to note is, when I click on one of the multiple definition errors, it brings up the 'new' file, with the cursor on the line which says:

    Code:
    inline void* operator new(std::size_t, void* __p) throw() { return __p; }
    What does this have to do with the "new" operator?
    Last edited by Programmer_P; 03-03-2011 at 11:24 PM.
    I'm an alien from another world. Planet Earth is only my vacation home, and I'm not liking it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 5 times "local function definitions are illegal"
    By Borislav in forum C++ Programming
    Replies: 24
    Last Post: 01-11-2011, 02:37 AM
  2. Compiling C in Visual Studio 2005
    By emanresu in forum C Programming
    Replies: 3
    Last Post: 11-16-2009, 04:25 AM
  3. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 01:49 PM
  4. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  5. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM