Solved

linking errors while compiling c++ console application

Posted on 2003-11-06
4
1,025 Views
Last Modified: 2013-12-14
I am getting following linking errors while compiling console application ...any ideas ?

msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "public: class std::basic_ostream<char,struct std::char_traits<char> > & __thiscall std::basic_ostream<char,struct std::char_traits<char> >::operator<<(unsigned long)" (??6?$basic_ostream@DU?$char_traits@D
@std@@@std@@QAEAAV01@K@Z) already defined in protocol.obj

msvcprtd.lib(MSVCP60D.dll) : error LNK2005: "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl std::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,char const *)" (??6std@@YAAAV?$basic_ostream@DU?$cha
r_traits@D@std@@@0@AAV10@PBD@Z) already defined in network.obj

network.obj : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> >  std::cerr" (?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A)

protocol.obj : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> >  std::cerr" (?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A)

revnetwork.obj : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> >  std::cerr" (?cerr@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A)

protocol.obj : error LNK2001: unresolved external symbol "class std::basic_ostream<char,struct std::char_traits<char> >  std::cout" (?cout@std@@3V?$basic_ostream@DU?$char_traits@D@std@@@1@A)

protocol.obj : error LNK2001: unresolved external symbol "private: static int  std::locale::id::_Id_cnt" (?_Id_cnt@id@locale@std@@0HA)

rawpacket.obj : error LNK2001: unresolved external symbol "private: static int  std::locale::id::_Id_cnt" (?_Id_cnt@id@locale@std@@0HA)

revnetwork.obj : error LNK2001: unresolved external symbol "private: static int  std::locale::id::_Id_cnt" (?_Id_cnt@id@locale@std@@0HA)

sock.obj : error LNK2001: unresolved external symbol _errno
0
Comment
Question by:nrusinh
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
tinchos earned 50 total points
ID: 9693904
The error LNK 2001 is either because you're missing the implementation of those functions or the definition of those variables.
To solve this, check that you have implemented those functions and defined those variables.

The error LNK 2005 is because the linker is findind 2 implementations for the same function and can't decide which one is the one that should be using. To solve this check that you have only one implementation for each function.

Hope this helps

Tincho

0
 
LVL 6

Expert Comment

by:GloomyFriar
ID: 9694297
0
 
LVL 9

Expert Comment

by:tinchos
ID: 10242573
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: tinchos {http:#9693904}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Tinchos
EE Cleanup Volunteer
0

Featured Post

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
eclipse luna javeEE perspecive missing 5 110
convert char array to number in c 5 85
eclipse compiler vs Installed JREs option 3 97
object oriented programming comparison 5 72
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question