1

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. https://github.com/bear24rw/rgb_table/tree/master/code/table_drivers/beat_finder (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.

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105

1 Answers1

1

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.

  • after changing it to ftdi1 in the makefile, now I get more output with several "undefined reference to" comments. and on the linux machine, when I removed 'termios.h' I then get fftw3.h: No such file or directory. But fftw3 is on my machine because the code required it to run. – Jeremy Gilbert Apr 03 '18 at 05:55
  • Now running the compiler on windows without i get `fft.c: In function ‘get_samples_do_fft’: fft.c:36:12: error: unknown type name ‘int16_t’ static int16_t buf[SAMPLE_SIZE]; ^~~~~~~ fft.c:40:34: error: ‘int16_t’ undeclared (first use in this function) int data = fread(buf, sizeof(int16_t), SAMPLE_SIZE, fifo_file); ^~~~~~~ fft.c:40:34: note: each undeclared identifier is reported only once for each function it appears in make: *** [makefile:9: fft.o] Error 1` – Jeremy Gilbert Apr 03 '18 at 06:03
  • definitions like: `int16_t` are defined in the header file: `ctype.h` Does your code include that header file? – user3629249 Apr 04 '18 at 05:16