0
votes

I'm using WSO2 CPP to develop an application running on an ARM Processor. I'm trying to cross-compile the library in a Linux based PC computer when I get an error at compilation time. I've configured WSO2 as:


    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

At compilation, the reported error is:

    /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'
[...]

It looks likes that the library with the error has not been configured with the CXXFLAGS variable: as you can see, includes to /home/logic/logic are not included in the compilation command.

Could you provide a fix to this problem?

Thanks and Best Regards, Joaquim Duran

2

2 Answers

0
votes

The problem is that it cant find the include files for openssl.

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

First check where openssl is installed for the environment being compiled on, then you need to tell the compiler where those includes are by specifying the include paths with the '-I' compilation flags.

When you configure the include paths, try to use absolute paths instead of the long relative paths that you have with several '../' paths. Its easier to debug include path problems this way.

0
votes

I had the same problem. For me it was two things. I needed to specify CFLAGS, not just CXXFLAGS. Also, I used a ~ in my path to point to home, which the build process did not like for some reason.