Sign in to follow this  
Shashwat Rohilla

Doubt in VS 2008

Recommended Posts

I have 64-bit Windows 7 and I'm using Visual Studio 2008
In that, we have two dropdowns at the top of the window

[b]Solution Configuration - [/b]which can have values either Debug or Release.
[b]Solultion Platform - [/b]which can have values either Win32, x86 or x64. Which platform does it refers to?

What does these means?

I tried running a basic C++ windows program. When it was Win32, it was not building giving some error. But when I changed it to x86, it was built.

Share this post


Link to post
Share on other sites
Debug = /DDEBUG at the command-line i.e. the equivalent of #define DEBUG for each C/C++ compilation
Release = /DRELEASE or (merely the lack of /DDEBUG?) ... see above

x86 = 32-bit target
x64 = 64-bit target

The latter two may affect things such as byte-alignment, type-sizes, etc. during compilation.

As for why your program didn't compile it's impossible for us to tell unless we can see the exact error message and corresponding code.

Share this post


Link to post
Share on other sites
[quote name='Shashwat Rohilla' timestamp='1306731336' post='4817382']
I tried running a basic C++ windows program. When it was Win32, it was not building giving some error. But when I changed it to x86, it was built.
[/quote]

thats actually kinda funny(well, to me)
you tried Build the 32Bit version and it did not Compile, so you chaanged that to thje 32Bit version(again) and it worked :P
:D :) :D

Share this post


Link to post
Share on other sites
[quote name='loom_weaver' timestamp='1306732086' post='4817385']
Debug = /DDEBUG at the command-line i.e. the equivalent of #define DEBUG for each C/C++ compilation
Release = /DRELEASE or (merely the lack of /DDEBUG?) ... see above
[/quote]
Can you explain me this?
What does #define DEBUG do?


[quote name='loom_weaver' timestamp='1306732086' post='4817385']
x86 = 32-bit target
x64 = 64-bit target
[/quote]

Then what does win32 means?

Share this post


Link to post
Share on other sites
[quote name='ryan20fun' timestamp='1306735032' post='4817398']
[quote name='Shashwat Rohilla' timestamp='1306731336' post='4817382']
I tried running a basic C++ windows program. When it was Win32, it was not building giving some error. But when I changed it to x86, it was built.
[/quote]

thats actually kinda funny(well, to me)
you tried Build the 32Bit version and it did not Compile, so you chaanged that to thje 32Bit version(again) and it worked :P
:D :) :D
[/quote]

It worked... Thanks...
But what is the difference between x86 and win32 then?

I have a 64-bit windows-7. Will it be able to run the program compiled for x86 (32-bit)

Share this post


Link to post
Share on other sites
[quote name='Shashwat Rohilla' timestamp='1306782781' post='4817615']
[quote name='ryan20fun' timestamp='1306735032' post='4817398']
[quote name='Shashwat Rohilla' timestamp='1306731336' post='4817382']
I tried running a basic C++ windows program. When it was Win32, it was not building giving some error. But when I changed it to x86, it was built.
[/quote]

thats actually kinda funny(well, to me)
you tried Build the 32Bit version and it did not Compile, so you chaanged that to thje 32Bit version(again) and it worked :P
:D :) :D
[/quote]

It worked... Thanks...
But what is the difference between x86 and win32 then?

I have a 64-bit windows-7. Will it be able to run the program compiled for x86 (32-bit)
[/quote]

nothing, x86 is name of the architecture it runs on
and yes, but all call etc get reroutered to the wow64 section

Share this post


Link to post
Share on other sites
[quote name='Shashwat Rohilla' timestamp='1306782459' post='4817613']
Can you explain me this?
What does #define DEBUG do?
[/quote]


You better start with the basics. To answer your question google "C Preprocessor" and in general find some good introductory books to C programming and Visual Studio.

Share this post


Link to post
Share on other sites
Setting the build target will cause DEBUG to be defined but simply defining DEBUG yourself will not set the necessary compiler flag to perform a debug build. Just thought I'd clarify that.

Share this post


Link to post
Share on other sites
[quote name='loom_weaver' timestamp='1306783457' post='4817619']
[quote name='Shashwat Rohilla' timestamp='1306782459' post='4817613']
Can you explain me this?
What does #define DEBUG do?
[/quote]

You better start with the basics. To answer your question google "C Preprocessor" and in general find some good introductory books to C programming and Visual Studio.
[/quote]

I know C Preprocessor.
I was just asking if #define DEBUG has some special meaning. Is DEBUG some special macro?

Also correct me
[b]x86 is the name of the architecture on which the win32 application runs.
win32 applications can also run on x64 through the use of WoW64.[/b]
[b]Why don't we have something called win64? Is it because it won't run on 32-bit system?[/b]

Share this post


Link to post
Share on other sites
[quote name='Shashwat Rohilla' timestamp='1306820674' post='4817765']
[b]x86 is the name of the architecture on which the win32 application runs.[/b]
[/quote]
Yes

[quote name='Shashwat Rohilla' timestamp='1306820674' post='4817765'][b]
win32 applications can also run on x64 through the use of WoW64.[/b]
[/quote]
Yes, it Emulates it, But there is [b]NO[/b] 16Bit Support, so legacy Code and software [b]will not[/b] run

[quote name='Shashwat Rohilla' timestamp='1306820674' post='4817765']
[b]Why don't we have something called win64? Is it because it won't run on 32-bit system?[/b]
[/quote]
do you mean for 32Bit PC's ?
i would say, because it would overflow it imidietly, 64Bit OS deals with larger Sizes and works slightly differently,
like some stuff is run on the OS level or something like that (bit too early in the morning for this)

Share this post


Link to post
Share on other sites
[quote name='Shashwat Rohilla' timestamp='1306820674' post='4817765']
I know C Preprocessor.
I was just asking if #define DEBUG has some special meaning. Is DEBUG some special macro?

Also correct me
[b]x86 is the name of the architecture on which the win32 application runs.
win32 applications can also run on x64 through the use of WoW64.[/b]
[b]Why don't we have something called win64? Is it because it won't run on 32-bit system?[/b]
[/quote]
_DEBUG is just a macro that compilers define for debug builds (not sure if the standard actually mandates it or just convention. Not sure the standard even really talks about build configurations?). Various bits of code are compiled differently based on what macros are defined (and in some cases the value of the macro), and the _DEBUG macro is one of those. There are also some other related macros like NDEBUG... Having _DEBUG defined (and NDEBUG not defined) will cause the compiled code to contain extra error checking and such.

For example the assert macro with NDEBUG isnt defined will stop the program if the assertion condition fails, but otherwise the macro is defined to nothing to that it has no performance impact on release builds.
[source lang="cpp"]
void foo(unsigned count)
{
//if NDEBUG isnt defined (at the point <cassert> was included),
//the expression is false, so the assert fails and the program stops so you can debug
//otherwise assert is defined as "#define assert(_Expression) ((void)0)"
//and thus no code at all is generated, so no impact on performance
assert(count > 0);
}
[/source]
Generally you would also enable other debugging features of the compiler (such as using the debug runtimes, disabling optimisation, generating some extra runtime checks, etc), as the standard DEBUG configuration does.




x86, x64, intel64, amd64, x64, win32, win64 etc tend to be used in confusing ways.
x64, intel 64, amd64 and x86-64 are all the same thing.

x86 and x64 are architectures (along with many others with Windows supporting a number at some point or another to some extent).

IIRC correctly. Win32 only ever refers to 32bit windows which will run on x86 (not sure if 32bit windows ever support other arcitectures and what it was refered to there, not sure either what will happen with this win 8 ARM thing I heared about), and Win64 refers to the 64bit versions of windows that is avaiable for IA-64 in addition to the x64.
In fact IIRC Win32 and Win64 refer more to the Windows API then the windows edition itself?


x64 is backwards compatible with x86, so x86 OS will run on x64 (might need some minor changes, not sure). x86 apps take a little more effort to run on x64 with an x64 SO, but IIRC this is more than interaction issue since you cant mix x86 and x64 in the same process (most likly due to differeing address sizes than anything else), so you have to use WoW64. AFAIK there is very little emulation in that, since the x64 CPU can run your x86 instructions directly (hence x86 apps seeing little if any performance impact of running on 64bit windows).


So essentialy in Visual Studio:
Picking the "Win32" platform means:[list][*]Your code will be compiled for the x86 instruction set[*]Your code will be compiled for Win32[*]Generally your compiled program will run on Win32 with x86, Win32 with x64, and Win64 with x64.[*]Allthough it will generally run on an x64 computer (either with win32 or win64 with WoW64), you dont get the x64 advantages[*]_WIN32, _M_IX86, _M_IX86_FP, get defined.[/list]
And picking x64 means:[list][*]Your code will be compiled for the x64 instruction set, and thus take advantage of more and larger registers, garunteed sse and sse2, larger address space, etc[*]VC doesnt support inline assembly with x64[*]Pointer types are 64 bits. Couple of other types like size_t get extended to 64bit. int is still [b]32bit[/b].[*]Your code will be compiled for Win64, and thus will not on Win32, even if the computer is an x64[*]_WIN32, _WIN64, and _M_X64 get define.[*]Couple of other minor changes like stack alignment that you likly wont care about right now....[/list]

Share this post


Link to post
Share on other sites
IA64 is Intels Version of the 64Bit architecture, wheres amd64 is supported on all 64Bit copable Machines.
there is really no point in using IA64 as there is minimal demand for it, just stick with amd64.

Share this post


Link to post
Share on other sites
[quote name='ryan20fun' timestamp='1306827565' post='4817788']
IA64 is Intels Version of the 64Bit architecture, wheres amd64 is supported on all 64Bit copable Machines.
there is really no point in using IA64 as there is minimal demand for it, just stick with amd64.
[/quote]

Sorry, this isn't quite true - IA64 is the Itanium 64-bit architecture (which is not x86 Architecture) - it is primarily used for specialist hardware applications. I have yet to ever see it used in production (some major corporations may use it).

But yes, there is basically never any reason to worry about IA64.

Basically think of it as this:

x86 - 32-Bit
x64 - 64-Bit

Debug - This allows special operations whilst running the debugging such as memory checking, assertions, etc. This will not work on machines which don't have VS 2008 installed.
Release - This is what you will provide your players/users. No requirement for VS 2008.

Share this post


Link to post
Share on other sites
[quote name='AndyEsser' timestamp='1312478112' post='4844571']
[quote name='ryan20fun' timestamp='1306827565' post='4817788']
IA64 is Intels Version of the 64Bit architecture, wheres amd64 is supported on all 64Bit copable Machines.
there is really no point in using IA64 as there is minimal demand for it, just stick with amd64.
[/quote]

Sorry, this isn't quite true - IA64 is the Itanium 64-bit architecture (which is not x86 Architecture) - it is primarily used for specialist hardware applications. I have yet to ever see it used in production (some major corporations may use it).

But yes, there is basically never any reason to worry about IA64.
[/quote]

yes you are right.
the difference is that the AMD64 Architecture is backwards compatible with the x86 Architecture, wheres IA64 is not.

[quote name='AndyEsser' timestamp='1312478112' post='4844571']
Debug - This allows special operations whilst running the debugging such as memory checking, assertions, etc. This will not work on machines which don't have VS 2008 installed.
Release - This is what you will provide your players/users. No requirement for VS 2008.
[/quote]

actually, you just need the debug version of the Runtime.

its all in the technicalities :D

Share this post


Link to post
Share on other sites
[quote]
Debug - This allows special operations whilst running the debugging such as memory checking, assertions, etc. This will not work on
machines which don't have VS 2008 installed.[/quote]
By VS 2008, do you mean .Net framework?

[quote]
Release - This is what you will provide your players/users. No requirement for VS 2008.
[/quote]
Will this run without .Net framework?

Share this post


Link to post
Share on other sites
[quote name='Shashwat Rohilla' timestamp='1312536864' post='4844922']
[quote]
Debug - This allows special operations whilst running the debugging such as memory checking, assertions, etc. This will not work on
machines which don't have VS 2008 installed.[/quote]
By VS 2008, do you mean .Net framework?
[/quote]

if it is C# BVB.Net F#
if it is build on the .Net FX it will need the .Net FX to run.

[quote name='Shashwat Rohilla' timestamp='1312536864' post='4844922']
[quote]
Release - This is what you will provide your players/users. No requirement for VS 2008.
[/quote]
Will this run without .Net framework?
[/quote]

that means that you are providing the Game / DLL that is linked to the Release Version of the Runtime, on other words; if you built your game with C++ and OpenGL all the end user has to de is run the game and it will work.

Share this post


Link to post
Share on other sites
[quote name='ryan20fun' timestamp='1312535938' post='4844917']
[quote name='AndyEsser' timestamp='1312478112' post='4844571']
Debug - This allows special operations whilst running the debugging such as memory checking, assertions, etc. This will not work on machines which don't have VS 2008 installed.
Release - This is what you will provide your players/users. No requirement for VS 2008.
[/quote]

actually, you just need the debug version of the Runtime.

its all in the technicalities :D
[/quote]

however as last I checked the EULA says you aren't allowed to distro the debug runtime you still require Visual Studio installed.

Share this post


Link to post
Share on other sites
[quote name='ryan20fun' timestamp='1312535938' post='4844917']
[quote name='AndyEsser' timestamp='1312478112' post='4844571']
Debug - This allows special operations whilst running the debugging such as memory checking, assertions, etc. This will not work on machines which don't have VS 2008 installed.
Release - This is what you will provide your players/users. No requirement for VS 2008.
[/quote]

actually, you just need the debug version of the Runtime.

its all in the technicalities :D
[/quote]

I was trying to keep things simple....:rolleyes:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this