I am trying to build an lzmat_lib compression library using Eclipse with Cygwin gcc. I downloaded the library from the link http://www.matcode.com/lzmat_lib.zip. The file has the following include files:
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <tchar.h>
#include "lzmat.h"
It cannot find the tchar.h
header file. I do not understand how to add this header file. Please suggest a solution.
Your options are to install a Windows development environment, like Visual Studio or mingw along with the Windows SDK, or to port the code to your cygwin (posix) environment.
To port the code, you'd just do this:
Remove #include <tchar.h>
.
Search and replace _TCHAR
to char
.
Search the file for all strings beginning with _t
and remove that prefix. E.g., _tfopen
becomes just fopen
. _tprintf
becomes printf
.
Search for the text _T
and remove it. You could also remove the extra parentheses that will then surround your string.
Deal with any other issues as they come up by removing the dependency on tchar.h
and using a standard function instead.