1

So, I need to use arm-none-eabi-gcc to run some authentications tests. But I've never used the cross compiler, and I can't find a lot of information on coding for it. Most importantly: I can't find a way to write a Client-Server program (client side using arm-gcc). I have tried re-using the code I wrote in plain C, with gcc, but it doesn't accept three of the libraries (namely, <sys/socket.h>, <netinet/in.h> and <netdb.h>), so I can't use it.

Can anyone help me by showing me a way through with I can make a micro controller contact a server in order to simulate an authentication trial?

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
AugustoQ
  • 213
  • 3
  • 14
  • Well, do you have the cross-compiler toolchain already? What OS are you running on the micro controller? – πάντα ῥεῖ Apr 27 '16 at 16:06
  • I do have the cross-compiler tool chain, for eclipse. The micro controller runs linux. – AugustoQ Apr 27 '16 at 16:11
  • Are you pointing the cross-compiler at the appropriate headers and libraries for the target system (either manually with `-I`/`-L` or the easy way with `--sysroot=`)? – Notlikethat Apr 27 '16 at 16:15
  • 2
    then you probably need to use arm-linux-gnueabi-gcc from the tool chain. `-none` is for bare metal applications. – user3528438 Apr 27 '16 at 16:23
  • 1
    @AugustoQ Related: http://stackoverflow.com/questions/18900855/how-to-work-with-external-libraries-when-cross-compiling – πάντα ῥεῖ Apr 27 '16 at 16:25
  • @user3528438 Is it in anyways possible to solve using -none? I was asked to do it using that. – AugustoQ Apr 27 '16 at 16:27
  • 1
    You can use `-I`, `-L`, `-Wl,-rpath`, `-Wl,-rpath-link`, `--sysroot` or even static linking to achieve that, but that's not a good idea because you don't know if the libraries are compatible with the compiler or not. If you are asked to compile a Linux application with `arm-none-eabi-gcc` you do need to know the rationale because the implied constraint could bite you later. – user3528438 Apr 27 '16 at 16:42
  • @user3528438 One last thing: is there any library for networking that I could use with arm-non-eabi-gcc without worry? One that doesn't depend on the system, or something like that. – AugustoQ Apr 28 '16 at 16:11

0 Answers0