Termios. H Error on Linux, -Lftdi Error on Windows. Cross Compiling
I Am Able to Compile This for Linux and Run It on Linux, but I Would Like to Be Able to Run It on My Windows Machine as Well. (Is This Allowed?) When I Try to...
I am able to compile this for linux and run it on linux, but I would like to be able to run it on my windows machine as well. (is this allowed?) When I try to cross compile it on my linux machine, I get an error saying Termios.h cannot be found. I read somewhere that termios.h and mingw don't work together. So then I spent hours downloading a few compiling tools for windows (on capped internet speeds) to try and make progress on windows since that's where I want to run the application anyway. I'm trying to use Cygwin now and when I try to compile it by making a few changes to the makefile to try and use
x86_64-pc-cygwin-gcc
I get
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:
cannot find -lftdi
collect2: error: ld returned 1 exit status
make: *** [makefile:6: main] Error 1
I have used the package installer for cygwin but I only found ftdi1, but I did find the ftdi.h raw file on github and copied it to my usr/include folder. so I'm not sure what to do from here but I'd really like to get this code running on my windows machine as an .exe I just need to know which direction I should go in, trying to solve the termios.h error on the linux machine, or ftdi.h error on the windows machine.
1 Answer
When I try to cross compile it on my linux machine, I get an error saying Termios.h cannot be found.
That's because <termios.h> describes terminal handling functionality which doesn't exist on Windows. However, I don't see any code in main.c which would actually depend on termios functionality -- you can probably just remove that #include.
As far as -lftdi goes, ftdi1 should be the right library. Make sure you've installed the -dev package from Cygwin.