0

I'm using ubuntu and I'm trying to cross-compile a C program for OpenWrt distribution. I tried to compile the code on ubuntu using gcc and it's working correctly. But when I tried to compile it using mips-openwrt-linux-gcc I get errors about headers (fatal error: openssl/conf.h: No such file or directory).

Main C file is main.c , I used to compile it using gcc main.c -lssl -lcrypto -o exec on ubuntu , now for cross-compilation I'm using mips-openwrt-linux-gcc main.c -lssl -lcrypto -o exec and this causes the problem I just mentioned.

Should I include headers in the toolchain directory? If yes how to do it for openwrt target?

Maxim
  • 52,561
  • 27
  • 155
  • 209
Amed
  • 57
  • 1
  • 7
  • Maybe the other compiler doesn't have "openssl/conf.h" in his search directory. – Alex Feb 15 '17 at 19:46
  • You have to "install" OpenSSL into your cross-compilation toolchain. For hints, see http://stackoverflow.com/questions/11841919/cross-compile-openssh-for-arm – jxh Feb 15 '17 at 19:55
  • 1
    Why not use the build toolchain OpenWRT provides? That will download/compile/build all required tools, libs, etc your target needs. And read the build instructions for your device on their website. – too honest for this site Feb 15 '17 at 20:30
  • @Olaf can you explain with details please ? – Amed Feb 15 '17 at 20:43
  • What was unclear? Surprisngly OpenWRT has a website and a Wiki with documentation. It might not be easy, but I can tell first-hand it works. – too honest for this site Feb 15 '17 at 20:55
  • Another hint: https://forum.openwrt.org/viewtopic.php?pid=148259#p148259 – jxh Feb 15 '17 at 22:05

0 Answers0