This is the mail archive of the
cygwin
mailing list for the Cygwin project.
A build problem of C++ code on Cygwin
- From: Angelo Graziosi <Angelo dot Graziosi at roma1 dot infn dot it>
- To: cygwin at cygwin dot com
- Date: Wed, 23 Aug 2006 00:42:10 +0200 (MET DST)
- Subject: A build problem of C++ code on Cygwin
I want to flag the following problem occurred on Cygwin BUT NOT on Linux.
=======
I have tried to build LiDIA (A C++ Library For Computational Number
Theory, http://www.informatik.tu-darmstadt.de/TI/LiDIA/) library on
Cygwin.
After the
./configure
the
make
failed:
-----------------------------------------------------------
cd library && make all
make[1]: Entering directory `/tmp/lidia-2.2.0/.build/library'
Making all in base
make[2]: Entering directory `/tmp/lidia-2.2.0/.build/library/base'
if g++ -DHAVE_CONFIG_H -I../../include -I../../src/base/include
-I../../../lib
rary/base/../../src/base/include -O2 -MT bytes_to_int_flag_generator.o
-MD -MP
-MF ".deps/bytes_to_int_flag_generator.Tpo" -c -o
bytes_to_int_flag_generator.o
`test -f '../../src/portability/bytes_to_int_flag_generator.cc' || echo
'../../
../library/base/'`../../src/portability/bytes_to_int_flag_generator.cc; \
then mv -f
".deps/bytes_to_int_flag_generator.Tpo" ".deps/bytes_to_int_f
lag_generator.Po"; else rm -f
".deps/bytes_to_int_flag_generator.Tpo"; exit 1; f
i
gcc bytes_to_int_flag_generator.o -o bytes_to_int_flag_generator
bytes_to_int_flag_generator.o:bytes_to_int_flag_generator.cc:(.text+0x17): undef
ined reference to `std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char>
>&, char const*)'
[....]
collect2: ld returned 1 exit status
make[2]: *** [bytes_to_int_flag_generator] Error 1
make[2]: Leaving directory `/tmp/lidia-2.2.0/.build/library/base'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/lidia-2.2.0/.build/library'
make: *** [all-subdirs] Error 2
-----------------------------------------------------------
It tries to build C++ with gcc:
gcc bytes_to_int_flag_generator.o -o bytes_to_int_flag_generator
The trick to solve this has been (before the 'make'):
cd library/base
g++ ../../../src/portability/bytes_to_int_flag_generator.cc \
-c -o bytes_to_int_flag_generator.o
g++ bytes_to_int_flag_generator.o -o bytes_to_int_flag_generator
cd ../..
then
make
In this way the build was completed succefully.
On Linux (with gcc 4.0.3) all worked fine:
./configure
make
----------------------------------------------------------------
cd library && make all
make[1]: Entering directory `/home/angelo/tmp/lidia-2.2.0/.build/library'
Making all in base
make[2]: Entering directory
`/home/angelo/tmp/lidia-2.2.0/.build/library/base'
if g++ -DHAVE_CONFIG_H -I../../include -I../../src/base/include
-I../../../lib
rary/base/../../src/base/include -O2 -MT bytes_to_int_flag_generator.o
-MD -MP
-MF ".deps/bytes_to_int_flag_generator.Tpo" -c -o
bytes_to_int_flag_generator.o
`test -f '../../src/portability/bytes_to_int_flag_generator.cc' || echo
'../../
../library/base/'`../../src/portability/bytes_to_int_flag_generator.cc; \
then mv -f
".deps/bytes_to_int_flag_generator.Tpo" ".deps/bytes_to_int_f
lag_generator.Po"; else rm -f
".deps/bytes_to_int_flag_generator.Tpo"; exit 1; f
i
/bin/sh ../../libtool --tag=CXX --mode=link g++ -O2 -o
bytes_to_int_flag_gene
rator bytes_to_int_flag_generator.o
mkdir .libs
g++ -O2 -o bytes_to_int_flag_generator bytes_to_int_flag_generator.o
./bytes_to_int_flag_generator > ../../include/bytes_to_int_flag.h
make all-am
...
----------------------------------------------------------------
So the question is : what could be the cause of this different behaviour ?
I have all Cygwin installed and updated.
I use GCC 3.4.4-2 (but also 3.4.4-1 gives the same results).
Cheers,
Angelo.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/