How to make a program against the ticonv library


  
You will find in the test folder of the libary source archive a test/example program which uses this library.
Below is listed a light version of this program to make it clearer:
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include <ticonv.h>

int main(int argc, char **argv)
{
  char ti92_varname[9] = { 0 };
  char *utf8;

  utf8 = ticonv_varname_to_utf8(CALC_TI92, ti92_varname, -1);
  printf("UTF-8 varname: <%s> (%i)\n", ti92_varname, (int)strlen(ti92_varname));
  g_free(utf8);
}
That's all !

NOTE: for this example to work, you probably have to add compiler options related to the include path and library path, e.g.
gcc -I/usr/include/tilp2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Os -g -Wall -W <...>.c -o <...> -lglib-2.0 -lticonv
or better
gcc -Os -g -Wall -W `pkg-config --cflags --libs ticonv` ticonv.c -o ticonv

Return to the main index