Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Termios.h error on linux, -lftdi error on windows. cross compiling

Writer Olivia Zamora

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.

3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.