错误交叉编译wsO2 CPP

时间:2012-05-22 14:34:33

标签: c++ cross-compiling wso2

我正在使用WSO2 CPP开发在ARM处理器上运行的应用程序。当我在编译时遇到错误时,我正试图在基于Linux的PC计算机中交叉编译库。我已将WSO2配置为:


    export CXXFLAGS="-O2 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -ffast-math -mfloat-abi=softfp"
    export CXXFLAGS=${CXXFLAGS}" -I/home/logic/Logic_BSPs/Linux_3.0/1021559_LogicPD_Linux_BSP_2.0-5p1/rootfs/usr/include"
    export LDFLAGS=" -L/home/logic/Logic_BSPs/Linux_3.0/1021559_LogicPD_Linux_BSP_2.0-5p1/rootfs/usr/lib"

    INSTALL_DIR=/home/logic/Logic_BSPs/Linux_3.0/1021559_LogicPD_Linux_BSP_2.0-5p1/rootfs/usr

    CC=/opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc \
    CXX=/opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-g++ \
    AR=/opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-ar \
    RANLIB=/opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-ranlib \
    ./configure --prefix=${INSTALL_DIR} \
        --build=i686-linux --host=arm-none-linux-gnueabi \
        --target=arm-none-linux-gnueabi --with-apache2=no

编译时,报告的错误是:

    /opt/CodeSourcery/Sourcery_G++_Lite/bin/arm-none-linux-gnueabi-gcc -DHAVE_CONFIG_H -I. -I../../../../.. -I../../../../../include -I../../../../../src/core/transport -I../../../../../src/core/transport/http -I../../../../../src/core/transport/http/sender/libcurl -I../../../../../src/core/description -I../../../../../src/core/context -I../../../../../src/core/phaseresolver -I../../../../../src/core/engine -I../../../../../src/core/deployment -I../../../../../util/include -I../../../../../axiom/include -g -O2 -D_LARGEFILE64_SOURCE -ansi -Wall -Wno-implicit-function-declaration -g -D_GNU_SOURCE -DAXIS2_SVR_MULTI_THREADED -DAXIS2_SSL_ENABLED -MT ssl_stream.lo -MD -MP -MF .deps/ssl_stream.Tpo -c ssl/ssl_stream.c  -fPIC -DPIC -o .libs/ssl_stream.o
    In file included from http_client.c:32:
    ssl/ssl_stream.h:26:25: error: openssl/ssl.h: No such file or directory
    make[11]: *** [http_client.lo] Error 1
    make[11]: *** Waiting for unfinished jobs....
    In file included from ssl/ssl_stream.c:21:
    ssl/ssl_stream.h:26:25: error: openssl/ssl.h: No such file or directory
    In file included from ssl/ssl_stream.c:22:
    ssl/ssl_utils.h:33: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
    ssl/ssl_utils.h:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
    ssl/ssl_utils.h:49: error: expected declaration specifiers or '...' before 'SSL_CTX'
    ssl/ssl_utils.h:50: error: expected declaration specifiers or '...' before 'SSL'
[...]

看起来有错误的库尚未配置CXXFLAGS变量:如您所见,编译命令中不包括/ home / logic / logic。

你能解决这个问题吗?

谢谢和最诚挚的问候, Joaquim Duran

2 个答案:

答案 0 :(得分:0)

问题是它无法找到openssl的包含文件。

    ssl/ssl_stream.h:26:25: error: openssl/ssl.h: No such file or directory

首先检查为正在编译的环境安装openssl的位置,然后您需要通过使用'-I'编译标志指定包含路径来告诉编译器这些包含的位置。

配置包含路径时,请尝试使用绝对路径,而不是使用多个“../”路径的长相对路径。它更容易调试包括路径问题。

答案 1 :(得分:0)

我遇到了同样的问题。对我来说这是两件事。我需要指定CFLAGS,而不仅仅是CXXFLAGS。另外,我在我的路径中使用〜指向home,由于某种原因构建过程不喜欢它。