Using multiple source files: Multiple Declarations & Wrong line numbers

This is a discussion on Using multiple source files: Multiple Declarations & Wrong line numbers within the C++ Programming forums, part of the General Programming Boards category; [EDIT] This problem was solved, i had a file that i kept saving with the wrong name, so it never ...

  1. #1
    Rebooted Inquirer's Avatar
    Join Date
    Apr 2002
    Posts
    281

    [SOLVED] Using multiple source files: Multiple Declarations & Wrong line numbers

    [EDIT] This problem was solved, i had a file that i kept saving with the wrong name, so it never really updated. Thanks anyway!
    [/EDIT]

    Wow, this is really weird. Somehow it thinks I am redefining a function where i am not, and even where a function isn't even being defined. Here are the errors:
    Code:
    g++ -pthread nemoserv.o nemoirc.o logger.o ircfunc.o sockfunc.o -o nemoserv
    nemoirc.o: In function `putServ(char *, int)':
    /home/ethereal/c++/nemoserv/nemoirc.h:83: multiple definition of `putServ(char *, int)'
    nemoserv.o:/home/ethereal/c++/nemoserv/logger.h:40: first defined here
    nemoirc.o: In function `putRawServ(char *, int)':
    /home/ethereal/c++/nemoserv/ircfunc.h:31: multiple definition of `putRawServ(char *, int)'
    nemoserv.o:/home/ethereal/c++/nemoserv/ircfunc.h:31: first defined here
    ircfunc.o: In function `putServ(char *, int)':
    /home/ethereal/c++/nemoserv/ircfunc.cpp:19: multiple definition of `putServ(char *, int)'
    nemoserv.o:/home/ethereal/c++/nemoserv/logger.h:40: first defined here
    ircfunc.o: In function `putRawServ(char *, int)':
    /home/ethereal/c++/nemoserv/ircfunc.cpp:32: multiple definition of `putRawServ(char *, int)'
    nemoserv.o:/home/ethereal/c++/nemoserv/ircfunc.h:31: first defined here
    collect2: ld returned 1 exit status
    make: *** [nemoserv] Error 1
    [NOTE]
    The attached file is only .zip for upload reasons, it is not actually a .zip file. It is a .tar.gz or a .tgz file.
    [/NOTE]
    Attached Files Attached Files
    Last edited by Inquirer; 04-30-2003 at 04:43 PM.
    Compilers:
    GCC on Red Hat 8.1 (Primary)
    GCC on Mac OS X 10.2.4 (Secondary)

    Others:
    MinGW on XP

  2. #2
    Rebooted Inquirer's Avatar
    Join Date
    Apr 2002
    Posts
    281
    Oh. I'd been experimenting with moving every single declaration from the .h and leaving only the prototypes, so i probably ended up fixing both problems without realizing it. Thanks for the tip.

    ~EtherealFlaim
    Compilers:
    GCC on Red Hat 8.1 (Primary)
    GCC on Mac OS X 10.2.4 (Secondary)

    Others:
    MinGW on XP

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Logical errors with seach function
    By Taka in forum C Programming
    Replies: 4
    Last Post: 09-18-2006, 05:20 AM
  2. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  3. Major glitch losing source files with MSVC++ and WinXP
    By JasonD in forum C++ Programming
    Replies: 10
    Last Post: 08-14-2003, 12:15 PM
  4. using a class in multiple source files???
    By Crossbow in forum C++ Programming
    Replies: 9
    Last Post: 06-18-2002, 07:42 PM
  5. Line Numbers in VI and/or Visual C++ :: C++
    By kuphryn in forum C++ Programming
    Replies: 2
    Last Post: 02-10-2002, 09:54 PM

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