Opened 4 years ago

Closed 8 weeks ago

#163 closed defect (migrated)

CBC doesn't build in VS2013

Reported by: sstewart Owned by: tkr
Priority: major Component: Cbc
Version: 2.9.2 Keywords:
Cc:

Description

I've been unsuccessful in building CBC using Cbc\stable\2.9\Cbc\MSVisualStudio\v10 with MS Visual Studio 2013. I get two linker errors: Error 59 error LNK2019: unresolved external symbol "int cdecl CbcMain1(int,char const * * const,class CbcModel? &)" (?CbcMain1@@YAHHQAPBDAAVCbcModel@@@Z) referenced in function _Cbc_solve@4 C:\Projects\Cbc\stable\2.9\Cbc\MSVisualStudio\v9\cbcCInterfaceDll\Cbc_C_Interface.obj cbcCInterfaceDll

and

Error 58 error LNK2019: unresolved external symbol "void cdecl CbcMain0(class CbcModel? &)" (?CbcMain0@@YAXAAVCbcModel@@@Z) referenced in function _Cbc_newModel@0 C:\Projects\Cbc\stable\2.9\Cbc\MSVisualStudio\v9\cbcCInterfaceDll\Cbc_C_Interface.obj cbcCInterfaceDll

Nor can I find the CBC binaries for windows for recent versions at

http://www.coin-or.org/Binaries/Cbc/

Nor do the older versions of those binaries contain what I think are the cbc dll's referred to in ticket #99 for use with other projects.

Change History (2)

comment:1 Changed 22 months ago by snorfalorpagus

I've managed to build the C interface DLL using the MSVC 2015 build tools. You need to make the following change in cbcCInterfaceDll.vcxproj:

Change:

<AdditionalDependencies?>libOsiClp.lib;%(AdditionalDependencies?)</AdditionalDependencies?>

To:

<AdditionalDependencies?>libCbcSolver.lib;libCbc.lib;libCgl.lib;libOsiClp.lib;libOsi.lib;libClp.lib;libCoinUtils.lib;%(AdditionalDependencies?)</AdditionalDependencies?>

There are 4 instances to replace (one for each build target).

I built this using the command line tools. You need to re-enable this project in the solution file.

msbuild Cbc.sln /p:PlatformToolset=v140 /p:Configuration=Release /p:Platform=x64

The resulting DLL seems to function as expected. I'm using it from Python with the ctypes library.

comment:2 Changed 8 weeks ago by stefan

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

This ticket has been migrated to GitHub and will be resolved there: https://github.com/coin-or/Cbc/issues/163

Note: See TracTickets for help on using tickets.