Setting Up the GCC Compiler
I setup a C environment as basic I could. There may be easier ways to go about this, but I wanted to use GCC to compile.
To setup the environment:
- I downloaded and setup MinGW32.
- I then downloaded FTD2XX libraries. This included the ftd2xx.h file and ftd2xx.lib.
- I then stole the test code from Hack-a-Day's article on bitbanging with the FTDI.
- I modified the code as they suggested by including, in this order, the Windows compatibility files:
#include <stdio.h> #include <stdarg.h> #include <stdlib.h> #include <windows.h> #include <windef.h> #include <winnt.h> #include <winbase.h> #include <string.h> #include <math.h> #include <stdbool.h> #include <stdint.h> #include "ftd2xx.h" #include <sys/time.h>
I used this line to build it:
$ gcc -o main main.c -L./ -lftd2xx
You must have both the ftd2xx.h and ftd2xx.lib in the same directory as you attempt to build.
As for editing, I've really grown to love Sublime Text 2.
If you have issues, make sure directory containing your files is in your PATH environment variable (I go over how to add the directory to your environment variables in this post).