Opened 6 years ago

Closed 8 weeks ago

#103 closed defect (migrated)

mingw32 cross-compiling cbc fail int

Reported by: ikus060 Owned by: stefan
Priority: major Component: build system
Version: 0.7 Keywords:
Cc:

Description

I do have problem to cross-compile cbc for windows using mingw32 on debian wheezy. On a fresh install, I've proceed as follow:

sudo apt-get install subversion build-essential gcc-mingw-w64 mingw-w64 mingw32
svn co https://projects.coin-or.org/svn/Cbc/stable/2.8 coin-cbc-2.8
cd coin-cbc-2.8
./configure --host=i686-w64-mingw32
make

make failed with the following error:

CoinOslFactorization.cpp: In function 'void* clp_align(void*)':
CoinOslFactorization.cpp:901:5: error: 'int64_t' was not declared in this scope
CoinOslFactorization.cpp:901:15: error: expected ';' before 'k'
CoinOslFactorization.cpp:902:10: error: 'k' was not declared in this scope
CoinFinite.hpp: At global scope:
CoinFinite.hpp:18:14: warning: 'COIN_DBL_MAX' defined but not used [-Wunused-variable]
CoinFinite.hpp:20:14: warning: 'COIN_INT_MAX_AS_DOUBLE' defined but not used [-Wunused-variable]
make[3]: *** [CoinOslFactorization.lo] Error 1
make[3]: Leaving directory `/home/debian/coin-cbc-2.8/CoinUtils/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/debian/coin-cbc-2.8/CoinUtils/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/debian/coin-cbc-2.8/CoinUtils'
make: *** [all-recursive] Error 1

Attached is my config.log

Attachments (1)

config.log (50.0 KB) - added by ikus060 6 years ago.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by ikus060

comment:1 Changed 6 years ago by ikus060

I forgot to mention. Cross compiling for windows 64bits is working from linux 64bits. I'm doing the following:

sudo apt-get install subversion build-essential gcc-mingw-w64 mingw-w64
svn co https://projects.coin-or.org/svn/Cbc/stable/2.8 coin-cbc-2.8
cd coin-cbc-2.8
export LDFLAGS="-static-libgcc -static-libstdc++"
./configure --target=x86_64-w64-mingw32 --host=x86_64-w64-mingw32
make

Meaning the problem is related to cross-compiling for windows 32 bits from a linux 64 bits is not working.

comment:2 Changed 6 years ago by stefan

Can you try if it works if you modify CoinUtils/src/CoinTypes.hpp to include stdint.h in any case?

  • CoinTypes.hpp

     
    77#define _CoinTypes_hpp
    88
    99#include "CoinUtilsConfig.h"
    10 #ifdef __MINGW64__
    1110#include <stdint.h>
    12 #endif
    1311
    1412#define CoinInt64 COIN_INT64_T
    1513#define CoinUInt64 COIN_UINT64_T

comment:3 Changed 6 years ago by ikus060

Thanks! Your modification make it work. To allow the same base code to be compiled for i686 and x86_64, what would be the right #ifdef ??

comment:4 Changed 8 weeks ago by stefan

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

Ticket has been migrated to GitHub and will be resolved there: https://github.com/coin-or-tools/BuildTools/issues/103

Note: See TracTickets for help on using tickets.