Tchar.h not found on cygwin

I am running the latest cygwin on Windows 7 (32-bit) and trying to create an open source project, RtAudio (it is not currently built on this platform).

One of the problems I worked with is the error on the #include <tchar.h> .

My build line:

 g++ -O2 -Wall -Iinclude -DHAVE_GETTIMEOFDAY -D__WINDOWS_DS__ -c RtAudio.cpp -o RtAudio.o 

Error:

 tchar.h: No such file or directory 

If I add / usr / include / mingw (which contains tchar.h) to the list of included paths, I get a lot more errors.

I worked on the problem without using LPCTSTR, and just overloading one function that requires it for const char* and const wchar_t* , so I could avoid including tchar.h, but is there a better way to do this

+4
source share
2 answers

tchar.h is the Windows title. Software must be ported to libiconv or ICU if it needs more than just the basics.

+5
source

If you want to create this for Cygwin, you must make sure that it uses Unix / Linux code codes, not Windows. In particular, the WIN32 macro is often used to protect Windows code, but it is also defined in Cygwin, so you may need to change any such security devices to #if defined(__WIN32__) && !defined(__CYGWIN__) .

Another way, of course, is to create this for native Windows. In Cygwin, you can do this with gcc-3 -mno-cygwin or the MinGW-w64 cross-compiler, which was recently added to the Cygwin distribution.

+2
source

All Articles