[Coin-discuss] windows - Visual Studio 6.0

Jörg Herbers herbers at hotmail.com
Mon May 10 03:48:47 EDT 2004


Hi Matt,

your problem is probably due to CoinFinite.hpp which #defines min and max:

#if defined(_MSC_VER)
...
#if !defined(min)
#define min(a,b)  (((a) < (b)) ? (a) : (b))
#endif
#if !defined(max)
#define max(a,b)  (((a) > (b)) ? (a) : (b))
#endif
#else
// Put standard min and max here
using std::min;
using std::max;
#endif

On Visual Studio .NET, I had the same problem and changed CoinFinite.hpp in 
order to use "using std::min / std::max" for MSVC7. Possibly this also works 
on MSVC6!? (But then, I don't know why CoinFinite.hpp uses this exception 
for MS compilers... Could someone clarify?)

Jörg



>>>magala at wnt.sas.com 5/9/2004 8:57:02 PM >>>
Hi Folks,

I am building COIN in M$ Windoze using Visual Studio 6.0 - for someone
else ;)

Found the following compiler errors (these are all easily fixable) in CLP:
c:\cygwin\home\mgalati\math\coin\clp\clpdynamicmatrix.cpp(1816) : error
C2374: 'j' : redefinition; multiple initialization
        c:\cygwin\home\mgalati\math\coin\clp\clpdynamicmatrix.cpp(1790)
: see declaration of 'j'
c:\cygwin\home\mgalati\math\coin\clp\clpgubdynamicmatrix.cpp(488) :
error C2374: 'j' : redefinition; multiple initialization

c:\cygwin\home\mgalati\math\coin\clp\clpgubdynamicmatrix.cpp(463) : see
declaration of 'j'
c:\cygwin\home\mgalati\math\coin\clp\clpgubdynamicmatrix.cpp(1411) :
error C2374: 'iColumn' : redefinition; multiple initialization

c:\cygwin\home\mgalati\math\coin\clp\clpgubdynamicmatrix.cpp(1027) : see
declaration of 'iColumn'
c:\cygwin\home\mgalati\math\coin\clp\clpgubdynamicmatrix.cpp(1737) :
error C2374: 'iSet' : redefinition; multiple initialization

c:\cygwin\home\mgalati\math\coin\clp\clpgubdynamicmatrix.cpp(1706) : see
declaration of 'iSet'
c:\cygwin\home\mgalati\math\coin\clp\clpgubmatrix.cpp(3610) : error
C2374: 'iSet' : redefinition; multiple initialization
        c:\cygwin\home\mgalati\math\coin\clp\clpgubmatrix.cpp(3599) :
see declaration of 'iSet'
c:\cygwin\home\mgalati\math\coin\clp\clppredictorcorrector.cpp(704) :
error C2360: initialization of 'iColumn' is skipped by 'case' label

c:\cygwin\home\mgalati\math\coin\clp\clppredictorcorrector.cpp(623) :
see declaration of 'iColumn'
c:\cygwin\home\mgalati\math\coin\clp\clppredictorcorrector.cpp(706) :
error C2374: 'iColumn' : redefinition; multiple initialization

c:\cygwin\home\mgalati\math\coin\clp\clppredictorcorrector.cpp(623) :
see declaration of 'iColumn'
c:\cygwin\home\mgalati\math\coin\clp\clppredictorcorrector.cpp(789) :
error C2360: initialization of 'iColumn' is skipped by 'case' label

c:\cygwin\home\mgalati\math\coin\clp\clppredictorcorrector.cpp(706) :
see declaration of 'iColumn'
c:\cygwin\home\mgalati\math\coin\clp\clppredictorcorrector.cpp(789) :
error C2360: initialization of 'iColumn' is skipped by 'case' label

c:\cygwin\home\mgalati\math\coin\clp\clppredictorcorrector.cpp(623) :
see declaration of 'iColumn'
c:\cygwin\home\mgalati\math\coin\clp\clppredictorcorrector.cpp(791) :
error C2374: 'iColumn' : redefinition; multiple initialization

c:\cygwin\home\mgalati\math\coin\clp\clppredictorcorrector.cpp(623) :
see declaration of 'iColumn'


Also, in CGL:
c:\cygwin\home\mgalati\math\coin\cgl\cglclique.cpp(154) : error C2589:
'(' : illegal token on right side of '::'
c:\cygwin\home\mgalati\math\coin\cgl\cglclique.cpp(154) : error C2059:
syntax error : '::'

These are related to the use of std::max in VS6.0, which conflicts with
windows max. I think if you change all the std::max to max and
#include<algorithm>, using namespace std at the top, this should be
portable.

Did I miss an announcement that CglClique had been added?


Also, at runtime, I crashed in CLP with the following stack:
KERNEL32! 7c57e592()
ROOT! _CxxThrowException at 8 + 57 bytes
ROOT! __RTDynamicCast + 383 bytes
ClpPackedMatrix::scale(ClpSimplex * 0x0012fad4) line 1255 + 23 bytes
ClpSimplex::createRim(int 31, unsigned char 1) line 2280 + 23 bytes
ClpSimplex::startup(int 0) line 5020 + 12 bytes
ClpSimplexDual::dual(int 0, int 0) line 220 + 10 bytes
ClpSimplex::dual(int 0) line 3359 + 14 bytes
OsiClpSolverInterface::initialSolve() line 193
main(int 2, char * * 0x002f1040) line 116 + 18 bytes
mainCRTStartup() line 206 + 25 bytes
KERNEL32! 7c581af6()

By adding NO_RTTI to the preprocessor defines and rebuilding CLP, it
seems to run fine.

Matt

--
Matthew Galati -- Optimization Developer
SAS Institute -- Analytical Solutions / Operations R & D
Office R4112 O: 919-531-0332 F: 919-677-4444
URL: http://sagan.ie.lehigh.edu/mgalati/


_______________________________________________
Coin-discuss mailing list
Coin-discuss at www-124.ibm.com
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail




More information about the Coin-discuss mailing list