Public Group

# Turning on Unicode in DevC++

This topic is 3078 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm getting a "DXUT requires a Unicode build" error from DirectX code that I have been given which should work. I've got the latest verstion of DevC++ and DirectX SDK.

How do I enable unicode in building of C++ projects in DevC++?

##### Share on other sites
Probably not what you want to hear, but why on earth are you using DevCpp? The DirectX SDK is not supported with it, and it's absolutely ancient.
What's wrong with Visual C++ Express?

##### Share on other sites
Don't know the anwser to your question, but do you have any particular reasons for why you are using DevC++? Check this out for why you shouldn't.

Microsoft Visual C++ Express, IMHO the best free IDE for Windows out there right now can simply be downloaded from an MSDN website. And since you are on Windows anyway, why not use it?

##### Share on other sites
Code::Block is somewhat in between Dev-C++ and Visual C++. It's faster and does pretty much the same thing.

http://www.codeblocks.org

##### Share on other sites
I'm suprised you both prefer the MS version. Other developers I know have said that dev-cpp is better as it is faster.

I don't mind either way so Iv'e installed VC++ Express.

The line
#include "dxsdkver.h"

Creates the following error:
fatal error C1083: Cannot open include file: 'dxsdkver.h': No such file or directory

How do I tell VC++ Express about thease files that are in "Program Files\Microsoft DirectX SDK (February 2010)". Do I need to make a copy of the includes directory from "Microsoft DirectX SDK ..." and put it with my project files?

##### Share on other sites
Quote:
 Original post by alan2hereI'm suprised you both prefer the MS version. Other developers I know have said that dev-cpp is better as it is faster.
On a lower-end machine, the IDE might feel more responsive, but personally I've never had any problems with performance on a even moderate machine (And to be honest, you're probably best having a reasonable machine for compiling to keep the rebuilds quick).

Quote:
 Original post by alan2hereHow do I tell VC++ Express about thease files that are in "Program Files\Microsoft DirectX SDK (February 2010)". Do I need to make a copy of the includes directory from "Microsoft DirectX SDK ..." and put it with my project files?
Clicky. Note that that's for VC2008, but 2010 should be almost identical. the SDK paths should be added automatically when you install the SDK (If you install it after Visual Studio, obviously), so you could also try uninstalling and reinstalling the SDK if you still have the installer handy.

##### Share on other sites
First of all, don't use Dev-C++. If you want to use MinGW, then go for Code::Blocks.

Second, this is your answer. Put this before the respective #include directives:
#define UNICODE 1

Yeah, that's all you need, really...

EDIT: coming to think on it, you could pass -DUNICODE=1 to GCC instead, which would also be cleaner too (this is assuming you're still using MinGW, MSVS has a separate compiler and the IDE provides it as a project option anyways).

[Edited by - Sik_the_hedgehog on July 13, 2010 1:38:48 PM]

##### Share on other sites
Thanks, youv'e all been verry helpfull.

##### Share on other sites
Keep in mind that "UNICODE" only switches things in the Windows headers. The C runtime headers use their own macro, which is "_UNICODE".

When you set the charset to Unicode in Visual C++, it defines both of those for you.

1. 1
2. 2
Rutin
20
3. 3
khawk
17
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 11
• ### Forum Statistics

• Total Topics
633758
• Total Posts
3013714
×