1、先编译openssl(buildlib.sh无法成功编译,后修改了Makefile编译成功),CC=mipsel-openwrt-linux-g++,生成了libssl.a和libcrypto.a,拷贝至ngrok-c-master目录。
2、修改openwrtbuild.sh,出现报错,求助!!!谢谢。
main.cpp:(.text+0x57c): warning: gethostbyname is obsolescent, use getnameinfo() instead.
build-mipsel-openssl/ngrok.o: In function ConnectMain(int*, sockaddr_in, ssl_info**, std::string*, std::map<int, sockinfo*, std::less<int>, std::allocator<std::pair<int const, sockinfo*> > >*, char*, char*)': ngrok.cpp:(.text+0x474): undefined reference to
ssl_init_info(int*, ssl_info*)'
ngrok.cpp:(.text+0x570): undefined reference to SSL_write' ngrok.cpp:(.text+0x6a0): undefined reference to
SSL_shutdown'
ngrok.cpp:(.text+0x6ac): undefined reference to SSL_free' ngrok.cpp:(.text+0x6b8): undefined reference to
SSL_CTX_free'
build-mipsel-openssl/ngrok.o: In function CmdSock(int*, sockinfo*, std::map<int, sockinfo*, std::less<int>, std::allocator<std::pair<int const, sockinfo*> > >*, sockaddr_in, std::string*, char*, std::list<TunnelInfo*, std::allocator<TunnelInfo*> >*, std::map<std::string, TunnelReq*, std::less<std::string>, std::allocator<std::pair<std::string const, TunnelReq*> > >*)': ngrok.cpp:(.text+0x1230): undefined reference to
SSL_read'
ngrok.cpp:(.text+0x1240): undefined reference to SSL_get_error' ngrok.cpp:(.text+0x15c8): undefined reference to
SSL_write'
ngrok.cpp:(.text+0x16ac): undefined reference to SSL_write' build-mipsel-openssl/ngrok.o: In function
RemoteSslInit(std::_Rb_tree_iterator<std::pair<int const, sockinfo*> >, sockinfo, std::string&, std::map<int, sockinfo*, std::less, std::allocator<std::pair<int const, sockinfo*> > >)':
ngrok.cpp:(.text+0x17c8): undefined reference to ssl_init_info(int*, ssl_info*)' ngrok.cpp:(.text+0x18a4): undefined reference to
SSL_write'
build-mipsel-openssl/ngrok.o: In function LocalToRemote(std::_Rb_tree_iterator<std::pair<int const, sockinfo*> >*, sockinfo*, ssl_info*, std::map<int, sockinfo*, std::less<int>, std::allocator<std::pair<int const, sockinfo*> > >*)': ngrok.cpp:(.text+0x19d4): undefined reference to
SSL_write'
build-mipsel-openssl/ngrok.o: In function ConnectLocal(ssl_info*, std::_Rb_tree_iterator<std::pair<int const, sockinfo*> >*, sockinfo*, std::map<int, sockinfo*, std::less<int>, std::allocator<std::pair<int const, sockinfo*> > >*, std::map<std::string, TunnelReq*, std::less<std::string>, std::allocator<std::pair<std::string const, TunnelReq*> > >*)': ngrok.cpp:(.text+0x1ab8): undefined reference to
SSL_read'
ngrok.cpp:(.text+0x1ac8): undefined reference to SSL_get_error' build-mipsel-openssl/ngrok.o: In function
RemoteToLocal(ssl_info, sockinfo*, std::_Rb_tree_iterator<std::pair<int const, sockinfo*> >, std::map<int, sockinfo, std::less, std::allocator<std::pair<int const, sockinfo*> > >*)':
ngrok.cpp:(.text+0x1e64): undefined reference to SSL_read' ngrok.cpp:(.text+0x1e74): undefined reference to
SSL_get_error'
build-mipsel-openssl/main.o: In function checkping()': main.cpp:(.text+0x358): undefined reference to
SSL_write'
build-mipsel-openssl/main.o: In function main': main.cpp:(.text.startup+0xb4): undefined reference to
SSL_library_init'
main.cpp:(.text.startup+0xbc): undefined reference to SSL_load_error_strings' main.cpp:(.text.startup+0xc4): undefined reference to
OPENSSL_add_all_algorithms_noconf'
build-mipsel-openssl/sendmsg.o: In function SendReqTunnel(int, ssl_st*, char*, char const*, char const*, char const*, int, char*)': sendmsg.cpp:(.text+0x1bc): undefined reference to
SSL_write'
build-mipsel-openssl/nonblocking.o: In function clearsock(int, sockinfo*)': nonblocking.cpp:(.text+0xa0): undefined reference to
SSL_shutdown'
nonblocking.cpp:(.text+0xac): undefined reference to SSL_free' nonblocking.cpp:(.text+0xb8): undefined reference to
SSL_CTX_free'
collect2: error: ld returned 1 exit status