Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with Compiling Error----------------

Status
Not open for further replies.

DaniDak

Technical User
Mar 13, 2002
44
US
Hi,
when I compile my code in Microsoft VC++6.0 I don't get any errors, but when I try to BUILD I get the link error LNK2005 multiple times. Does anyone know what could be wrong.

thank you



Compiling...
binarytree.cpp
main.cpp
Linking...
main.obj : error LNK2005: "public: void __thiscall Btree::add(int)" (?add@Btree@@QAEXH@Z) already defined in binarytree.obj
main.obj : error LNK2005: "public: void __thiscall Btree::addin(class Bnode *,int)" (?addin@Btree@@QAEXPAVBnode@@H@Z) already defined in binarytree.obj
main.obj : error LNK2005: "public: void __thiscall Btree::print(void)" (?print@Btree@@QAEXXZ) already defined in binarytree.obj
main.obj : error LNK2005: "public: void __thiscall Btree::display(class Bnode *)" (?display@Btree@@QAEXPAVBnode@@@Z) already defined in binarytree.obj
Debug/Program.exe : fatal error LNK1169: one or more multiply defined symbols found
Error executing link.exe.

Program.exe - 5 error(s), 0 warning(s)
 
Try <i>rebuilding</i>. My stab in the dark guess is that you are trying to build something that already exists.
 
Doh! I guess HTML doesn't work here. I think tek-tips needs some tek-tips. Is anyone else frustrated that the only working italic tags ( [.i.] without the dots ) are commonly used for counters in C++? (I know you can just uncheck the TGML box, but I wish it were off by default).

Enough of my rant. The rebuild option is found in the build menu drop-down.
 
>> commonly used for counters in C++?

That's funny LOL. I remember when I first started posting here of course I ran into that same thing. I no longer use i as a variable... havn't for several years now. LOL

Ok, maybe it's not that funny.

mostly use n now. oh yeah... don't use b either... is anyone still reading this... I bet not.... I don't blame you. :)

-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top