交叉编译paho.mqtt.c需要用到ssl库,就先编译openssl,下载的openssl-1.1.0h。首先在ubuntu上用gcc编译ok。然后更换gcc如下
./config no-asm shared --prefix=$PWD/install --cross-compile-prefix=mipsel-openwrt-linux-,编译最后报错
./libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead.
./libcrypto.so: undefined reference to `getcontext'
./libcrypto.so: undefined reference to `setcontext'
./libcrypto.so: undefined reference to `makecontext'
同样的代码,为什么换个gcc就报错了?不知道该怎么解决了。
PS:我先是使用的 openssl-1.0.2o.tar.gz交叉编译没有报错,paho.mqtt.c也没有报错(已修改makefile,引用的ssl都是交叉编译后的ssl库文件),但是sample里面的文件放到MT7688上执行报错./MQTTClient_subscribe: line 1: syntax error: unexpected word (expecting ")")。
哪位大神能指导下,没头绪了~
