Doubt in VS 2008

Started by
17 comments, last by AndyEsser 12 years, 8 months ago
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

Solution Configuration - which can have values either Debug or Release.
Solultion Platform - 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.

Advertisement
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.

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.


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

Never say Never, Because Never comes too soon. - ryan20fun

Disclaimer: Each post of mine is intended as an attempt of helping and/or bringing some meaningfull insight to the topic at hand. Due to my nature, my good intentions will not always be plainly visible. I apologise in advance and assure you I mean no harm and do not intend to insult anyone.


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

Can you explain me this?
What does #define DEBUG do?



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


Then what does win32 means?

[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.


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 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.


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

Never say Never, Because Never comes too soon. - ryan20fun

Disclaimer: Each post of mine is intended as an attempt of helping and/or bringing some meaningfull insight to the topic at hand. Due to my nature, my good intentions will not always be plainly visible. I apologise in advance and assure you I mean no harm and do not intend to insult anyone.


Can you explain me this?
What does #define DEBUG do?



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.
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.

[quote name='Shashwat Rohilla' timestamp='1306782459' post='4817613']
Can you explain me this?
What does #define DEBUG do?


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
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.

Why don't we have something called win64? Is it because it won't run on 32-bit system?

x86 is the name of the architecture on which the win32 application runs.

Yes


win32 applications can also run on x64 through the use of WoW64.


Yes, it Emulates it, But there is NO 16Bit Support, so legacy Code and software will not run


Why don't we have something called win64? Is it because it won't run on 32-bit system?

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)

Never say Never, Because Never comes too soon. - ryan20fun

Disclaimer: Each post of mine is intended as an attempt of helping and/or bringing some meaningfull insight to the topic at hand. Due to my nature, my good intentions will not always be plainly visible. I apologise in advance and assure you I mean no harm and do not intend to insult anyone.

This topic is closed to new replies.

Advertisement