Menu

#55 [mingw32] cross compiling fails on linux

v1.0_(example)
open
nobody
None
5
2015-02-18
2013-07-28
No

Starting with r267 cross compiling does not work anymore.

I am using your library for my project https://github.com/ferkulat/csv2xls.

I am not using windows, but I want to provide a windows binary too.
So I am used to cross compile it with mingw on linux.

If you need, I am willing to help as far as I can.

Thank You in advance

for release 2.3.4 the following worked:

export CXX=i486-mingw32-g++
export CC=i486-mingw32-gcc
sed -ie "/AX_CC_PRAGMA_PACK/d" configure.ac
sed -ie "s/^#error/#warning/" src/common/xls_pshpack1.h
sed -ie "s/^#error/#warning/" src/common/xls_pshpack2.h
sed -ie "s/^#error/#warning/" src/common/xls_poppack.h
sed -ie "s/^#error/#warning/" src/common/xls_pshpack4.h
bash bootstrap
./configure --prefix=/usr/i486-mingw32 --host=i486-mingw32 --build=i686-linux
make

to compile r266 i had to do:

export CXX=i486-mingw32-g++
export CC=i486-mingw32-gcc
sed -ie "/AX_CC_PRAGMA_PACK/d" configure.ac
sed -ie "/targets\/test\/Makefile/d" configure.ac
sed -ie "s/targets//" Makefile.am
bash bootstrap
./configure --prefix=/usr/i486-mingw32 --host=i486-mingw32 --build=i686-linux --disable-assertions 
make

Starting with r267 I get the following error:

Making all in src
make[1]: Entering directory `/home/eagle/devel/mingw32-xlslib/src/xlslib/xlslib/src'
/bin/sh ../libtool  --tag=CXX   --mode=compile i486-mingw32-g++ -DHAVE_CONFIG_H -I. -I../src/common  -I../src/data -I../src/oledoc -I../src/common -I../src/xlslib   -g -O2 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -MT assert_assist.lo -MD -MP -MF .deps/assert_assist.Tpo -c -o assert_assist.lo `test -f 'xlslib/assert_assist.cpp' || echo './'`xlslib/assert_assist.cpp
xlslib/assert_assist.cpp: line 1: /bin: Is a directory
xlslib/assert_assist.cpp: line 2: Makefile: command not found
xlslib/assert_assist.cpp: line 3: Makefile: command not found
xlslib/assert_assist.cpp: line 4: syntax error near unexpected token `('
xlslib/assert_assist.cpp: line 4: ` * for dynamic generation of Excel(TM) files.'
libtool: compile:  i486-mingw32-g++ -DHAVE_CONFIG_H -I. -I../src/common -I../src/data -I../src/oledoc -I../src/common -I../src/xlslib -g -O2 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -MT assert_assist.lo -MD -MP -MF .deps/assert_assist.Tpo -c ""  -DDLL_EXPORT -DPIC -o .libs/assert_assist.o
i486-mingw32-g++: error: : No such file or directory
i486-mingw32-g++: fatal error: no input files
compilation terminated.
make[1]: *** [assert_assist.lo] Error 1

~~~~~~~

Discussion

  • David Hoerl

    David Hoerl - 2013-07-29

    assert_assist.cpp hasn't changed in years (although the copyright got erased, which I just fixed). Can you look at your file and see what is at the top of the file - it would seem the block comment up top has either gotten replaced or changed so that the compiler is seeing it.

     
  • Marcel Schneider

    The top of assert_assist.cpp is:

    /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
     *
     * This file is part of xlslib -- A multiplatform, C/C++ library
     * for dynamic generation of Excel(TM) files.
     *
    3 *
     * Redistribution and use in source and binary forms, with or without modification, are
     * permitted provided that the following conditions are met:
     *
     *    1. Redistributions of source code must retain the above copyright notice, this list of
     *       conditions and the following disclaimer.
    

    So I think the error is not in this file.
    What I don't understand, is the connection between the *.cpp and a Makefile in the error message.

    It seems either libtool messes something up or the generated Makefile(s) have some problems.

    It is strange: If I make the xlslib with mingw on Windows, it works

     

Log in to post a comment.