TCHAR has not been declared

hi, i am just starting with C++ and my friend sent me a code.

I typed the code exactly as it appeared, and it still gave me the TCHAR has not been declared

I have no idea what i did wrong.
TCHAR is a Windows thing. Make sure you have #include <window.h> at the top.
Ok, Ive added that . I ran a compile & Run and it said "No Such File/Directory"
Last edited on
sorry, <windows.h>, with an 's'
Did the same thing, tried with both
If you haven't installed the Win32 API libraries and headers then it won't work. What compiler are you using?
Bloodshed (that free one)
We've deprecated Dev-C++. That thing hasn't been updated in years, which in computer years is centuries.

You'll probably need Visual Studio, which you can download a free version of here:
http://www.microsoft.com/express/Windows/

Happy coding!

-Albatross
Last edited on
We? Zillions of people still use it -- and it has actively developed forks, like wxDev-C++ (http://wxdsgn.sourceforge.net/) -- but it is an IDE; the compiler it uses is the GCC. The version of Dev-C++ you are using comes with an outdated version of the GCC, so you'll need to upgrade. Just go the MinGW downloads and get the latest version -- download all the files you need, including the Win32 API. Open your Dev-C++ folders and delete the MinGW directory, then unzip/untar/execute/unpack/whatever all the MinGW stuff into a new MinGW directory in your Dev-C++ folders. http://www.mingw.org/ http://sourceforge.net/projects/mingw/files/

Good luck!

[edit] Personally, I don't use it nor will I ever -- I can't stand it
Last edited on
http://tdragon.net/recentgcc/ for latest gcc windows port, the sourceforge mingw site also contains an very old version.
Last edited on
Topic archived. No new replies allowed.