   windows.h namespace
  is there any way i can contain the junk in windows.h and keep it seporate from my game code, im trying namespaces but whaterver i try to it dosent like it,even something simple likenamespace win32{#include <windows.h>}using namespace win32;i getundefined reference to `WinMain@16'   
  Are you making a console application or a Win32 application? That error makes it seem like the linker is looking for a Win32 application which needs a WinMain function rather than main.   ;  its a win32 application, but it has a WinMain function//namespace win32{#include <windows.h>//}//using namespace win32;works fine;  I tried it with VC6 (which compiler and version are you using?) and it didn't complain.// testing.cpp : Defines the entry point for the application.//#include "stdafx.h"namespace win32{#include <windows.h>}using namespace win32;int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTRlpCmdLine, int  nCmdShow){ // TODO: Place code here.MessageBox(0, "Test", "Test", 0);return 0;}removing the using namespace part and trying to run win32::MessageBox didn't work though.   ;Quote:Original post by nprzremoving the using namespace part and trying to run win32::MessageBox didn't work though.That's because "MessageBox" really is a macro that expands to MessageBoxA in MBCS mode and to MessageBoxW in Unicode mode. Since a lot of stuff (e.g. almost all API  functions that involve strings, be it as parameter or as return value) in the windows headers is just macros, it makes little sense trying to put that into a namespace. It will only cause lots of confusion and "mysterious" compile errors [smile].Cheers,Pat   ;  im useing devC++does WINAPI WinMainmake a diffrence   ;  You should use int WINAPI WinMain(.......) and so windows doesnt include all the bloat you can #define WIN32_LEAN_AND_MEAN   ;Quote:Original post by Kazeim useing devC++does WINAPI WinMainmake a diffrenceI don't know, but the "WINAPI" is just another macro that simply hides the function's calling convention. So if your compiler's (some GCC version, I suppose) default calling convention isn't the same as the one defined by "WINAPI", the linker wouldn't be able to find that function, I guess (though it should work anyway if the symbol is defined *shrug*).;  sorry for my slow response, but I had to download, install and compile it with DevC++.I changed the function toint WINAPI win32::WinMain (HINSTANCE hThisInstance,...and it seemed to compile and run.   ;Quote:Original post by nprzsorry for my slow response, but I had to download, install and compile it with DevC++.I changed the function toint WINAPI win32::WinMain (HINSTANCE hThisInstance,...and it seemed to compile and run.wow,thanks,not sure why WinMain needs it seporatly but it works fine