The vc2010 link error error LNK2005



The picture is dependent on my engineering diagram of the classes in the UML level probably said I A--> B represents a class A depends on the type of B
Program at link time reported the following error, on the Internet to find, can't solve, please have a look.
1> Generating code...
1>CDBConnPool.obj : error LNK2005: "private: static class CDBConnPool * CDBConnPool::pInstance" (?pInstance@CDBConnPool@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CPathDispatch.obj : error LNK2005: "private: static class ServThreadPool * ServThreadPool::pInstance" (?pInstance@ServThreadPool@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CPathDispatch.obj : error LNK2005: "private: static class CDBConnPool * CDBConnPool::pInstance" (?pInstance@CDBConnPool@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CPathDispatch.obj : error LNK2005: "private: static class CTollStationManage * CTollStationManage::pInstance" (?pInstance@CTollStationManage@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CServerInterface.obj : error LNK2005: "private: static class ServThreadPool * ServThreadPool::pInstance" (?pInstance@ServThreadPool@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CServerInterface.obj : error LNK2005: "private: static class CDBConnPool * CDBConnPool::pInstance" (?pInstance@CDBConnPool@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CServerInterface.obj : error LNK2005: "private: static class CTollStationManage * CTollStationManage::pInstance" (?pInstance@CTollStationManage@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CTollStation.obj : error LNK2005: "private: static class CDBConnPool * CDBConnPool::pInstance" (?pInstance@CDBConnPool@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CTollStationManage.obj : error LNK2005: "private: static class CDBConnPool * CDBConnPool::pInstance" (?pInstance@CDBConnPool@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CTollStationManage.obj : error LNK2005: "private: static class CTollStationManage * CTollStationManage::pInstance" (?pInstance@CTollStationManage@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CPathCalculate.obj : error LNK2005: "private: static class ServThreadPool * ServThreadPool::pInstance" (?pInstance@ServThreadPool@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CPathCalculate.obj : error LNK2005: "private: static class CDBConnPool * CDBConnPool::pInstance" (?pInstance@CDBConnPool@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>CPathCalculate.obj : error LNK2005: "private: static class CTollStationManage * CTollStationManage::pInstance" (?pInstance@CTollStationManage@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>ServThreadPool.obj : error LNK2005: "private: static class ServThreadPool * ServThreadPool::pInstance" (?pInstance@ServThreadPool@@0PAV1@A) Is already defined in the CalculateCenterServ.obj
1>LINK: fatal error LNK1104: cannot open the file"libboost_thread-vc100-mt-gd-1_54.lib"

Started by Walker at November 19, 2016 - 2:22 PM

1 repeat file contains
2 local cannot call

Posted by maker at December 04, 2016 - 3:00 PM

1 files are added to the UML class diagram of #ifdef is also not closed loop should not have repeat contains.
2 local cannot call is what mean?

Posted by Walker at December 07, 2016 - 3:58 PM

1>CDBConnPool.obj : error LNK2005: "private: static class CDBConnPool * CDBConnPool::pInstance" (?pInstance@CDBConnPool@@0PAV1@A) Has been in the CalculateCenterServ.obj
The error code corresponding to paste up have a look

Posted by maker at December 15, 2016 - 4:49 PM

private:
static CDBConnPool* pInstance;
public:
static CDBConnPool* getInstance(){
if(pInstance == NULL)
pInstance = new CDBConnPool();
return pInstance;
}
};
CDBConnPool* CDBConnPool::pInstance = NULL;

CalculateCenterServ.h is the same as that of single cases

Posted by Walker at December 30, 2016 - 5:47 PM

The project, property, the linker, conventional, additional library catalog: fill in additional dependent Library Directory semicolon interval number
The project, property, the linker, input, additional dependencies: fill in additional dependent library name.Lib spaces or semicolon interval number

Rebuild all

Posted by Jacqueline at January 02, 2017 - 7:10 PM

PInstance a name change.!

Posted by maker at January 07, 2017 - 6:27 PM

I want to be a static variable initialization you put in the.H file inside, but in other file inside include many times, you should see the initialization part on the.Cpp file inside.

Posted by Dean at January 08, 2017 - 7:36 PM