Skip to main content
GameDev.net gamedev.net
🔒 Locked

Turning on Unicode in DevC++

Started by alan2here Jul 13, 2010 at 6:16 AM 7 replies 14k views
Original Post
alan2here
alan2here
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++?
Evil Steve
Evil Steve
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?
michaweyel
michaweyel
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?
Markhor
Markhor
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
alan2here
alan2here
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?
Evil Steve
Evil Steve
Quote:
Original post by alan2here
I'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 alan2here
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?
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.
Sik_the_hedgehog
Sik_the_hedgehog
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]
Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.
alan2here
alan2here
Thanks, youv'e all been verry helpfull.
MJP
MJP
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.