[Coin-discuss] problems with cross-compiling CoinUtils for Windows

Kish Shen kish.shen at crosscoreop.com
Tue Apr 15 21:17:08 EDT 2008


Hi,

I cross-compile the COIN libraries for MS Windows using mingw32msvc on a (x86) Linux box.
For recent trunk branch of Cbc, I get a compiler error that gettimeofday() is not defined
when compiling CoinTime.cpp in CoinUtils. The problem seems to be in CoinTime.hpp -- the
wrong definition of CoinGetTimeOfDay() is selected for compiling  -- there is a #if macro
that is currently defined as:

#if defined(_MSC_VER)

(line 30 in my copy of CoinTime.hpp)

which does not seem to catch the cross-compiling case. I modified this back to:

 #if defined(_MSC_VER) || defined(__MSVCRT__)

which was what was there in older versions of the file that compiled without error. 

With this change, I was able to compile Cbc. Is this the correct fix for the problem? 

Cheers,

Kish



More information about the Coin-discuss mailing list