[Symphony] troubleshooting "unresolved symbol" using OSI

Erik Hammel hammyz at gmail.com
Wed Apr 25 18:44:03 EDT 2012


hi,

I've been struggling with trying to get Symphony's OSI extension to work
when compiling a C++ program. I've tried the sample code milpOsi.c (after
renaming to *.cpp) with the same error: "obj\Release\test script.o:test
script.cpp:(.text.startup+0x8e)||undefined reference to
`OsiSymSolverInterface::OsiSymSolverInterface()'|"


in other attempts (e.g. instantiating a pointer to OsiSymSolverInterface),
i would get the same error for the next function i tried. i know it's a
linker error, but i can't figure out what library it's looking for so i can
make sure it's being linked properly.

there is a bit of backstory but hopefully i can avoid getting into it. i'm
using MinGW_w64's g++.exe (yes, tried it with standard MinGW g++) via
Code::Blocks IDE, and i've instructed it to look in \SYMPHONY-5.4.4\lib for
the libraries and have tried explicitly specifying to link to these
libraries: libCgl.a  libClp.a  libCoinUtils.a  libOsi.a  libOsiClp.a
 libOsiCommonTests.a  libOsiSym.a  libSym.a (these are the only *.a files
present in the lib directory). I'm also using glpk for GMPL support by the
way. here's the command line invocation that Code::Blocks is issuing to the
compiler:

g++.exe -Wall -fexceptions  -O2  -O2 -Weffc++
-IC:\Apps\Programming\SYMPHONY-5.4.4\SYMPHONY\include
-IC:\Apps\Programming\MinGW_w64\include
-IC:\Apps\Programming\SYMPHONY-5.4.4\include\coin
-IC:\Apps\Programming\SYMPHONY-5.4.4\ThirdParty\Glpk\glpk\include  -c
C:\Apps\Programming\SYMPHONY-5.4.4\SYMPHONY\Examples\test\milpOsi.cpp -o
obj\Release\milpOsi.o
In file included from
C:\Apps\Programming\SYMPHONY-5.4.4\include\coin/OsiSymSolverInterface.hpp:24:0,
                 from
C:\Apps\Programming\SYMPHONY-5.4.4\SYMPHONY\Examples\test\milpOsi.cpp:17:
C:\Apps\Programming\SYMPHONY-5.4.4\include\coin/SymWarmStart.hpp:28:7:
warning: 'class SymWarmStart' has pointer data members [-Weffc++]
C:\Apps\Programming\SYMPHONY-5.4.4\include\coin/SymWarmStart.hpp:28:7:
warning:   but does not override 'operator=(const SymWarmStart&)' [-Weffc++]
C:\Apps\Programming\SYMPHONY-5.4.4\include\coin/SymWarmStart.hpp: In
constructor 'SymWarmStart::SymWarmStart()':
C:\Apps\Programming\SYMPHONY-5.4.4\include\coin/SymWarmStart.hpp:34:4:
warning: 'SymWarmStart::warmStart_' should be initialized in the member
initialization list [-Weffc++]
g++.exe -LC:\Apps\Programming\SYMPHONY-5.4.4\lib
-LC:\Apps\Programming\MinGW_w64\lib
-LC:\Apps\Programming\SYMPHONY-5.4.4\lib  -o bin\Release\test.exe
obj\Release\milpOsi.o   -s
obj\Release\milpOsi.o:milpOsi.cpp:(.text.startup+0x6d): undefined reference
to `OsiSymSolverInterface::OsiSymSolverInterface()'
obj\Release\milpOsi.o:milpOsi.cpp:(.text.startup+0x91): undefined reference
to `OsiSymSolverInterface::parseCommandLine(int, char**)'
obj\Release\milpOsi.o:milpOsi.cpp:(.text.startup+0x9e): undefined reference
to `OsiSymSolverInterface::loadProblem()'
obj\Release\milpOsi.o:milpOsi.cpp:(.text.startup+0xab): undefined reference
to `OsiSymSolverInterface::branchAndBound()'
obj\Release\milpOsi.o:milpOsi.cpp:(.text.startup+0xc0): undefined reference
to `OsiSymSolverInterface::~OsiSymSolverInterface()'
obj\Release\milpOsi.o:milpOsi.cpp:(.text.startup+0xf7): undefined reference
to `OsiSymSolverInterface::~OsiSymSolverInterface()'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
6 errors, 3 warnings


i've tried to get this working for a day now, otherwise i wouldn't have
bothered anyone. apologies if this is a repost problem and thanks in
advance to any who can help. :)


-- erik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/symphony/attachments/20120425/c45b11ad/attachment.html>


More information about the Symphony mailing list