Code::Blocks Forums

User forums => Help => Topic started by: Chachii on December 16, 2014, 11:33:32 pm

Title: A lot of problems with DirectX 9 Apps
Post by: Chachii on December 16, 2014, 11:33:32 pm
I'm running Windows 7 64 bit OST, using a custom "extension" to the Visual Studio 2010 compiler (I'm using the same settings as the VS2010 Compilier, just I added new directories for DirectX features)

Compiler Settings:
http://puu.sh/dxALr/a0408ab788.png

Code for the file I'm working with that has the error:
http://pastebin.com/06xv938x

The errors I get are:
Code
C:\Users\Chachii\Documents\C++\HitlersRevenge\Assets\Windows.cpp(58) : error C2731: 'wWinMain' : function cannot be overloaded
        C:\Users\Chachii\Documents\C++\HitlersRevenge\Assets\Windows.cpp(57) : see declaration of 'wWinMain'
C:\Users\Chachii\Documents\C++\HitlersRevenge\Assets\Windows.cpp(71) : error C2440: 'initializing' : cannot convert from 'const wchar_t [10]' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Users\Chachii\Documents\C++\HitlersRevenge\Assets\Windows.cpp(120) : error C2664: 'UnregisterClassA' : cannot convert parameter 1 from 'const wchar_t [10]' to 'LPCSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

I've tried a lot of things.  Setting the Debugger to Console/GUI, various other methods of creating a DX9 Window, etc.
Title: Re: A lot of problems with DirectX 9 Apps
Post by: oBFusCATed on December 17, 2014, 12:46:22 am
Do you have UNICODE or _UNICODE defined?
Why are you using UnregisterClass instead of UnregisterClassW?

Consider reading this http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F and other FAQ entries... search the internet for similar errors, etc.

And finally - This question is hardly related to C::B, so the topic might be locked, because you're violating the rules.