[Cbc] Linking Cbc 2.7

Stefan Vigerske stefan at math.hu-berlin.de
Mon Nov 28 18:26:41 EST 2011


Hi,

try reorder your link line to have -lOsiCbc before the cbc lib.

Stefan

> Dear all,
>
> I am getting an error linking to Cbc 2.7 (from the SVN and 2.7.5), and I
> was hoping somebody has a suggestion.
>
> I built Cbc from source, including the third party libraries.
>
> With the following linker command, I am receiving the following error:
>
> g++ MipModelACoin.o MipModelA.o main.o -m64
> -L/home/kevt/Utilities/coin/coin-Cbc/lib
> -L/home/kevt/Utilities/coin/coin-Cbc/ThirdParty/Lapack/lib
> -L/home/kevt/Utilities/coin/coin-Cbc/ThirdParty/Blas/lib -lCbc
> -lCbcSolver -lCgl -lOsi -lOsiCbc -lOsiClp -lClp -lCoinUtils -lcoinlapack
> -lcoinblas -lgfortran -lm -o mip
>
> /home/kevt/Utilities/coin/coin-Cbc/lib/libOsiCbc.so: undefined reference
> to `CbcModel::CbcModel(CbcModel const&, bool)'
> /home/kevt/Utilities/coin/coin-Cbc/lib/libOsiCbc.so: undefined reference
> to `CbcStrategyDefault::~CbcStrategyDefault()'
> /home/kevt/Utilities/coin/coin-Cbc/lib/libOsiCbc.so: undefined reference
> to `CbcModel::setStrategy(CbcStrategy&)'
> /home/kevt/Utilities/coin/coin-Cbc/lib/libOsiCbc.so: undefined reference
> to `CbcStrategyDefault::CbcStrategyDefault(int, int, int, int)'
> /home/kevt/Utilities/coin/coin-Cbc/lib/libOsiCbc.so: undefined reference
> to `CbcModel::CbcModel(OsiSolverInterface const&)'
> /home/kevt/Utilities/coin/coin-Cbc/lib/libOsiCbc.so: undefined reference
> to `CbcModel::~CbcModel()'
> /home/kevt/Utilities/coin/coin-Cbc/lib/libOsiCbc.so: undefined reference
> to `CbcModel::passInMessageHandler(CoinMessageHandler*)'
> /home/kevt/Utilities/coin/coin-Cbc/lib/libOsiCbc.so: undefined reference
> to `CbcModel::branchAndBound(int)'
> collect2: ld returned 1 exit status
>
> Does anyone know why that error is happening? It doesn't really make any
> sense to me, since I have the libCbc library int he same directory as
> the libOsiCbc library (they were built together at the same time...)
>
> My system is Ubuntu 11.10 64bit.
>
> Thanks for your help.
>
> Kevin
> _______________________________________________
> Cbc mailing list
> Cbc at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cbc
>


-- 
Stefan Vigerske
Humboldt University Berlin, Numerical Mathematics
http://www.math.hu-berlin.de/~stefan


More information about the Cbc mailing list