Jump to content
  • Advertisement
Sign in to follow this  
alan2here

Turning on Unicode in DevC++

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
Share on other sites
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.

Share this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!