This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

最新版evm-02.00库的arm-g++有严重问题



最近换成了最新版库。

发现用G++编译的时候容易出问题。一些基础库的路径好像没有设置对。

我编译一个以前工程的时候出现最基本的iostream找不到,然后又是bit/c++config.h找不到。

makefile里面强制指定路径解决。

但是下面这个问题我得请教了:

开发板没有ftp,因此我想编译lftp。

下载lftp-4.6.5版本。

运行./configure --target=arm-linux-gnueabi --host=arm-linux-gnueabi --build=x86_64-linux --with-libtool-sysroot=/home/xiongzechong/ti/ti-processor-sdk-linux-am335x-evm-02.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-linux-gnueabi

返回:

****

checking if c++ compiler works... cross-compiling
checking if c++ compiler can handle dynamic initializers... yes
checking whether g++ supports bool type... no
checking whether g++ understands ANSI scoping rules... no
configure: error: C++ compiler does not understand ANSI scoping rules

这个ANSI特性应该是G++很早以前(2000年前就支持的吧)。

TI这个g++工具怎么没有验证过就发布了。

  • 楼主明显用错编译器了,在pc机上交叉编译应该是x86_64-arago-linux,另外,TI的cross compile是linaro做的。

    我试过,是可以用的。你编译不成功并不是gcc的bug,而是你操作问题,gcc 4.9目前已知的bug只有error-time的bug。

    export PATH=$PATH:$JAVA_HOME/bin:/opt/ti-processor-sdk-linux-am335x-evm-02.00.00.00/linux-devkit/sysroots/x86_64-arago-linux/usr/bin

    ./configure CC=arm-linux-gnueabihf-gcc --host=arm-linux-gnueabihf --prefix=$PWD/install

  • 如Richard所述,请确认下是否是我们最新SDK包里的交叉编译工具。

  • 不多说了,请你下个lftp或者cmdftp任何版本。

    试试先source一下environment文件,

    运行./configure $CONFIGURE_FLAGS看看。

    以前的SDK我一直这么用很方便。

    成功了告诉我解决办法。我试了一下不是你们描述的gcc路径问题。

    另外请再做个实验,自己写个helloworld.cpp,用g++编一下看看iostream找不找得到。

    相信会有新发现。

  • vim hello.c

    #include <iostream>
    using namespace std;
    int main()
    {
        cout << "Hello world!\n" << endl;
        return 0;
    }

    root@H81M-DS2:/home/work/test# arm-linux-gnueabihf-g++ -o hello hello.c
    root@H81M-DS2:/home/work/test# ll

    总用量 24
    drwxr-xr-x  2 root    root     4096  1月  5 09:30 ./
    drwxrwxr-x 40 richard richard  4096 12月 24 10:02 ../
    -rwxr-xr-x  1 root    root    11786  1月  5 09:30 hello*
    -rw-r--r--  1 root    root      102  1月  5 09:28 hello.c

    一切正常

  • ng@ubuntu:~/ti/ti-processor-sdk-linux-am335x-evm-02.00.00.00/linux-devkit$ . environment-setup

    [linux-devkit]:~/realtime> make
    arm-linux-gnueabihf-g++ -march=armv7-a -marm -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a8 --sysroot=~/ti/ti-processor-sdk-linux-am335x-evm-02.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-linux-gnueabi -O2 -c pram.cpp
    In file included from pram.cpp:1:0:
    global.h:32:18: fatal error: string: No such file or directory
    #include <string>
    ^
    compilation terminated.
    make: *** [pram.o] Error 1

    Makefile:

    pram.o : pram.cpp pram.h global.h 

    $(CXX) $(CXXFLAGS) -c pram.cpp