You need to first compile the g2 library, either a static (.lib) or dynamic (.dll) version from the sources that you downloaded.
After this, you can start using the library.
Note that if your program is for Windows, I'd follow the scheme outlined in simple_win32.c (i.e. include g2_win32, and don't include anything for X11):
#include <stdio.h>
#include <g2.h>
#include <g2_win32.h>
int main()
{
int d;
d=g2_open_win32(100, 100, "simple_win32", 0);
g2_line(d, 10, 10, 90, 90);
getchar();
return 0;
}