C Board  

Go Back   C Board > General Programming Boards > C++ Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 04-30-2003, 04:36 PM   #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
File Type: zip all.tgz.zip (7.8 KB, 34 views)
__________________
Compilers:
GCC on Red Hat 8.1 (Primary)
GCC on Mac OS X 10.2.4 (Secondary)

Others:
MinGW on XP

Last edited by Inquirer; 04-30-2003 at 04:43 PM.
Inquirer is offline   Reply With Quote
Old 05-01-2003, 02:52 PM   #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
Inquirer is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 12:53 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

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