Solved

linking errors while compiling c++ console application

Posted on 2003-11-06
4
1,030 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

726 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