Problem when compile AJTCL with cross-compiler
Hi All,
I met a problem when compile the Alljoyn Thin Client Library with mipsel-openwrt-linux-uclibc-gcc . I used version 14.02 which was downloaded from https://www.alljoyn.org/docs-and-downloads . It is fine if I compile the source code with default Sconscript which was using gcc. My target device is runing OpenWRT.
mipsel-openwrt-linux-uclibc-gcc -o target/linux/aj_target_crypto.o -c -Wall -pipe -static -funsigned-char -Wpointer-sign -Wimplicit-function-declaration -fno-strict-aliasing -g -DAJ_MAIN -Iinc -Itarget/linux target/linux/aj_target_crypto.c
target/linux/aj_target_crypto.c:29:25: error: openssl/aes.h: No such file or directory
target/linux/aj_target_crypto.c:30:24: error: openssl/bn.h: No such file or directory
target/linux/aj_target_crypto.c:40: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'keyState'
target/linux/aj_target_crypto.c: In function 'AJ_AES_Enable':
target/linux/aj_target_crypto.c:44: warning: implicit declaration of function 'AES_set_encrypt_key'
target/linux/aj_target_crypto.c:44: error: 'keyState' undeclared (first use in this function)
target/linux/aj_target_crypto.c:44: error: (Each undeclared identifier is reported only once
target/linux/aj_target_crypto.c:44: error: for each function it appears in.)
target/linux/aj_target_crypto.c: In function 'AJ_AES_CTR_128':
target/linux/aj_target_crypto.c:62: warning: implicit declaration of function 'AES_encrypt'
target/linux/aj_target_crypto.c:62: error: 'keyState' undeclared (first use in this function)
target/linux/aj_target_crypto.c: In function 'AJ_AES_CBC_128_ENCRYPT':
target/linux/aj_target_crypto.c:74: warning: implicit declaration of function 'AES_cbc_encrypt'
target/linux/aj_target_crypto.c:74: error: 'keyState' undeclared (first use in this function)
target/linux/aj_target_crypto.c:74: error: 'AES_ENCRYPT' undeclared (first use in this function)
target/linux/aj_target_crypto.c: In function 'AJ_AES_ECB_128_ENCRYPT':
target/linux/aj_target_crypto.c:79: error: 'keyState' undeclared (first use in this function)
target/linux/aj_target_crypto.c: In function 'AJ_RandBytes':
target/linux/aj_target_crypto.c:84: error: 'BIGNUM' undeclared (first use in this function)
target/linux/aj_target_crypto.c:84: error: 'bn' undeclared (first use in this function)
target/linux/aj_target_crypto.c:84: warning: implicit declaration of function 'BN_new'
target/linux/aj_target_crypto.c:85: warning: implicit declaration of function 'BN_rand'
target/linux/aj_target_crypto.c:86: warning: implicit declaration of function 'BN_bn2bin'
target/linux/aj_target_crypto.c:87: warning: implicit declaration of function 'BN_free'
scons: *** [target/linux/aj_target_crypto.o] Error 1
scons: building terminated because of errors.
I met new problem when try to compile Alljoyn Thin Client Library version 14.06. I just use command "scons" to build
congngale@CONGNGALE-PC:~/Work/Alljoyn/alljoyn-suite-14.06.00_beta-src/core/ajtcl$ scons
scons: Reading SConscript files ...
GTEST_DIR is not set, skipping unittest build
scons: done reading SConscript files.
scons: Building targets ...
/opt/toolchain-mipsel_gcc-4.3.3+cs_uClibc-0.9.33.2/usr/bin/mipsel-openwrt-linux-uclibc-gcc -o samples/basic/basic_client samples/basic/basic_client.o src/aj_about.o src/aj_bufio.o src/aj_bus.o src/aj_cert.o src/aj_connect.o src/aj_crc16.o src/aj_creds.o src/aj_crypto.o src/aj_debug.o src/aj_disco.o src/aj_guid.o src/aj_helper.o src/aj_init.o src/aj_introspect.o src/aj_keyauthentication.o src/aj_keyexchange.o src/aj_link_timeout.o src/aj_msg.o src/aj_nvram.o src/aj_peer.o src/aj_serial.o src/aj_serial_rx.o src/aj_serial_tx.o src/aj_std.o src ...
Please show the entire scons command line you are using. Also are you building this inside the OpenWrt system or just using the compilers?
stevek ( 2014-09-10 14:21:42 -0800 )editI used the command "scons" to build.
congngale ( 2014-09-10 19:59:00 -0800 )editYou have still not posted the exact scons command line that you are using. Without that, I cannot tell you how to fix the scons line.
stevek ( 2014-09-11 12:10:38 -0800 )editI just update the error and you can see i only use "scons" to build.
congngale ( 2014-09-12 00:33:44 -0800 )editscons by default does not use mipsel-openwrt-linux-uclibc-gcc. What scons related environment variables have you set? What changes have you made to the scons files?
stevek ( 2014-09-12 08:27:31 -0800 )edit