TCHAR has not been declared

Feb 7, 2011 at 1:53am
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.
Feb 7, 2011 at 1:56am
TCHAR is a Windows thing. Make sure you have #include <window.h> at the top.
Feb 7, 2011 at 1:59am
Ok, Ive added that . I ran a compile & Run and it said "No Such File/Directory"
Last edited on Feb 7, 2011 at 1:59am
Feb 7, 2011 at 4:11am
sorry, <windows.h>, with an 's'
Feb 9, 2011 at 2:18am
Did the same thing, tried with both
Feb 9, 2011 at 2:20am
If you haven't installed the Win32 API libraries and headers then it won't work. What compiler are you using?
Feb 9, 2011 at 2:21am
Bloodshed (that free one)
Feb 9, 2011 at 2:30am
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 Feb 9, 2011 at 2:45am
Feb 9, 2011 at 9:32pm
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 Feb 9, 2011 at 9:33pm
Feb 10, 2011 at 8:31am
http://tdragon.net/recentgcc/ for latest gcc windows port, the sourceforge mingw site also contains an very old version.
Last edited on Feb 10, 2011 at 8:32am
Topic archived. No new replies allowed.