0

I'm struggling with autotools plugin in Eclipse and some C++ project I have downloaded.

My goal consists on cross-compilng for an arm processor, so the project is already configured to work with autotools, but when I try to crosscompile I have the following issue

In file included from /usr/include/c++/4.6/bits/stl_algo.h:61:0,
                 from /usr/include/c++/4.6/algorithm:63,
                 from dtntracepath.cpp:17:
/usr/include/c++/4.6/cstdlib:119:11: error: ‘::malloc’ has not been declared

I've checked out the configure output of my project noticing this

...
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... no
checking for memset... yes
...

I know how to fix it through linux terminal through adding the option

export ac_cv_func_malloc_0_nonnull=yes 

but non through Eclipse or autotools pluging, since the settings of the project aren't available. May you enlighten me?

Kind regards,

Thanks in advance

PS: the parameters which I've set in autotools plugin are the following ones:

-Command: configure  CFLAGS="-m32" LDFLAGS="-m32"  CC=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc CC=c99
-All options :  --host=arm-mv5sft-linux-gnueabi --build=i686-linux --target=arm-mv5sft-linux-gnueabi --with-sysroot=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi/

EDITED:

I have tried ldav1s advice an using the following configure

configure CC=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc CXX=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++  CFLAGS="-m32" LDFLAGS="-m32"  

I get these errors

Command-line environment variables:
     LDFLAGS="-m32" LDFLAGS="-m32" CC="/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc" CXX="/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++"

sh -c /home/t/ibrdtn/ibrdtn-tools-0.8.0/configure      ++ --host=arm-mv5sft-linux-gnueabi --with-sysroot=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/arm-mv5sft-linux-gnueabi/ 
configure: WARNING: you should use --build, --host, --target
configure: WARNING: invalid host type: ++
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-mv5sft-linux-gnueabi-strip... no
checking for arm-mv5sft-linux-gnueabi-strip... no
checking for strip... strip
configure: WARNING: using cross tools not prefixed with host triplet
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
Invalid configuration `++': machine `++' not recognized
configure: error: /bin/bash ./config.sub ++ failed
configure: error: /bin/bash ./config.sub ++ failed
checking build system type... 

Configuration failed with error

EDIT2 After reinstalling eclipse the ++ errors of first edition were gone, now if I use the following configuration

configure CC=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc CXX=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++ CFLAGS="-m32" LDFLAGS="-m32"--host=arm-mv5sft-linux-gnueabi --build=i686-linux --target=arm-mv5sft-linux-gnueabi

It was compiling properly, I have seen some arm/le outputs, but I have got this error concerning to one of the libraries

make[3]: Entering directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon/net'
  CXX    tcpclient.lo
  CXX    tcpserver.lo
  CXX    tcpstream.lo
  CXX    udpsocket.lo
  CXX    MulticastSocket.lo
  CXX    UnicastSocket.lo
  CXX    stopandwait.lo
  CXX    vsocket.lo
  CXX    vinterface.lo
  CXX    vaddress.lo
  CXX    LinkManager.lo
In file included from LinkManager.cpp:16:
../../ibrcommon/net/NetLinkManager.h:19:29: error: netlink/netlink.h: No such file or directory
../../ibrcommon/net/NetLinkManager.h:20:26: error: netlink/attr.h: No such file or directory
make[3]: *** [LinkManager.lo] Error 1
make[3]: Leaving directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon/net'
make[2]: Leaving directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon'
make[2]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/t/ibrdtn/ibrcommon-0.8.0/ibrcommon'
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1

**** Build Finished ****
ndarkness
  • 1,011
  • 2
  • 16
  • 36

1 Answers1

0

You haven't set up the C++ compiler (CXX) as part of your arguments to configure, as well as multiply defining the C compiler (CC).

You seem to be picking up the compiler for the build machine (the ones in /usr/include) instead of the one for the crosscompiler (the ones in /home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1).

ldav1s
  • 15,885
  • 2
  • 53
  • 56
  • Thanks for replying,so in order to choose the proper crosscompilers, should I use something similar to this: `code configure CFLAGS="-m32" LDFLAGS="-m32" CC=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-gcc CXX=/home/t/s/arm-mv5sft-linux-gnueabi/SW3.2p1/bin/arm-mv5sft-linux-gnueabi-g++ ` ? – ndarkness Feb 05 '13 at 15:12
  • I did use that configure above and I was retreived that error, any suggestion of why it cannot understand the ++?? – ndarkness Feb 06 '13 at 10:55
  • Why is `++` there? The arguments to `configure` don't look right. – ldav1s Feb 06 '13 at 18:06
  • I have no clue!! What I'm going to do is to reinstall eclipse....I'm fed up of this weird behaviours. – ndarkness Feb 06 '13 at 20:19
  • Eclipse reinstalled, I tried the command again, getting the outputs of EDIT2 in main post. Thanks! – ndarkness Feb 07 '13 at 08:21