Opened 12 years ago

Closed 12 years ago

#26 closed defect (fixed)

cbc not linking on windows with MS Visual Studio

Reported by: jpfasano Owned by: somebody
Priority: major Component: component1
Version: Keywords:
Cc:

Description

The Trunk version CoinSolve.cpp (cbcSolve project) does not link on window with MS Visual Studio Version 8. The link error is

------ Build started: Project: cbcSolve, Configuration: Release Win32 ------
Linking...
MyMessageHandler.obj : error LNK2005: "public: __thiscall MyMessageHandler::MyMessageHandler(void)" (??0MyMessageHandler@@QAE@XZ) already defined in CoinSolve.obj
MyMessageHandler.obj : error LNK2005: "public: __thiscall MyMessageHandler::MyMessageHandler(class CoinMessageHandler const &)" (??0MyMessageHandler@@QAE@ABVCoinMessageHandler@@@Z) already defined in CoinSolve.obj
MyMessageHandler.obj : error LNK2005: "public: virtual __thiscall MyMessageHandler::~MyMessageHandler(void)" (??1MyMessageHandler@@UAE@XZ) already defined in CoinSolve.obj
MyMessageHandler.obj : error LNK2005: "public: virtual int __thiscall MyMessageHandler::print(void)" (?print@MyMessageHandler@@UAEHXZ) already defined in CoinSolve.obj
MyMessageHandler.obj : error LNK2005: "public: __thiscall MyMessageHandler::MyMessageHandler(class MyMessageHandler const &)" (??0MyMessageHandler@@QAE@ABV0@@Z) already defined in CoinSolve.obj
MyMessageHandler.obj : error LNK2005: "public: class MyMessageHandler & __thiscall MyMessageHandler::operator=(class MyMessageHandler const &)" (??4MyMessageHandler@@QAEAAV0@ABV0@@Z) already defined in CoinSolve.obj
MyMessageHandler.obj : error LNK2005: "public: virtual class CoinMessageHandler * __thiscall MyMessageHandler::clone(void)const " (?clone@MyMessageHandler@@UBEPAVCoinMessageHandler@@XZ) already defined in CoinSolve.obj
.\Release/cbcSolve.exe : fatal error LNK1169: one or more multiply defined symbols found
Build log was saved at "file://d:\COIN\Coin-Cbc-All\trunk\Cbc\MSVisualStudio\v8\cbcSolve\Release\BuildLog.htm"
cbcSolve - 8 error(s), 0 warning(s)


It seems that this link problem was probably introduced on 7/31 with the change https://projects.coin-or.org/Cbc/changeset/715

To recreate:

  1. svn checkout https://projects.coin-or.org/svn/Cbc/trunk coin-Cbc-trunk
  1. open the file coin-Cbc-trunk/Cbc/MSVisualStudio/v8/Cbc.sln with visual studio C++ express edition.
  1. From the menu bar select "Build" - "Batch Build", and then rebuild everything.

Change History (1)

comment:1 Changed 12 years ago by forrest

  • Resolution set to fixed
  • Status changed from new to closed

Made conditional and changed to MyMessageHandler2

Note: See TracTickets for help on using tickets.