Author Topic: How do I setup global #define's in C::B?  (Read 4024 times)

Offline lucky7456969

  • Multiple posting newcomer
  • *
  • Posts: 33
How do I setup global #define's in C::B?
« on: April 04, 2014, 07:25:37 am »
Hello, in my C++ application,
How to setup UNICODE global variable in C::B?
Code
||=== Build: Debug in Test (compiler: GNU GCC Compiler) ===|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3d9types.h|25|warning: ignoring #pragma warning  [-Wunknown-pragmas]|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3d9types.h|2411|warning: ignoring #pragma warning  [-Wunknown-pragmas]|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3d9.h|2025|warning: "/*" within comment [-Wcomment]|
C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Include\d3d9.h|2026|warning: "/*" within comment [-Wcomment]|
E:\Jacky\Documents\C++ Projects\Test\main.cpp||In function 'int wWinMain(HINSTANCE, HINSTANCE, LPWSTR, int)':|
E:\Jacky\Documents\C++ Projects\Test\main.cpp|84|error: cannot convert 'const wchar_t*' to 'LPCSTR {aka const char*}' in initialization|
E:\Jacky\Documents\C++ Projects\Test\main.cpp|88|error: cannot convert 'const wchar_t*' to 'LPCSTR {aka const char*}' for argument '2' to 'HWND__* CreateWindowExA(DWORD, LPCSTR, LPCSTR, DWORD, int, int, int, int, HWND, HMENU, HINSTANCE, LPVOID)'|
E:\Jacky\Documents\C++ Projects\Test\main.cpp|108|error: cannot convert 'const wchar_t*' to 'LPCSTR {aka const char*}' for argument '1' to 'BOOL UnregisterClassA(LPCSTR, HINSTANCE)'|
||=== Build failed: 3 error(s), 4 warning(s) (0 minute(s), 0 second(s)) ===|

It seems like it is looking for the UNICODE global #define where I don't know where to set it in the IDE.
Let me know
Thanks
Jack

Offline lucky7456969

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: How do I setup global #define's in C::B?
« Reply #1 on: April 04, 2014, 07:58:46 am »
Hi there,
I suddenly realize I can't compile DirectX code using mingw, however, I can do so with VS2010
But one thing, how do I setup, as codeblocks would generate everything in UNICODE, hence strings with L""
I want Visual Studio to have default of UNICODE in codeblocks, how do I set it up?
Thanks
Jack

Offline lucky7456969

  • Multiple posting newcomer
  • *
  • Posts: 33
Re: How do I setup global #define's in C::B?
« Reply #2 on: April 04, 2014, 08:12:02 am »
I have it.
-DUNICODE in Visual studio other options
thanks