Question Compile in 64bit?

TheDeathly

Well-known member
Joined
Oct 21, 2009
Messages
50
Programming Experience
1-3
Well, im working a chat program, and my main problem right now is 64bit. it works flawlessly with 32bit. I just cant figure out how if even possible to compile in 64bit... Any help?
 
I don't have VB Express installed here to confirm this and its default configuration is a little different to VS.

If you are running on a 64-bit system then the app will run in 64-bit mode by default. The same output will run in 32-bit mode on a 32-bit system and in 64-bit mode on a 64-bit system.

If you're running on a 32-bit system then i don't think you have the option of compiling specifically for a 64-bit target. On a 64-bit system you can target either. To target a specific platform you need to open the Configuration Manager, which I believe you do from the Build menu. Under Active Solution Platform select New and then specify your desired target platform.
 
In Express the default platform is "Any CPU", which means the app will adapt automatically to the executing system. With my 32bit OS I can also create an new specific platform for a configuration, choosing between CPUs Itanium/x86/x64, but attempting to build for anything other than x86 in IDE will of course fail since IDE tries to load it. A common gotcha with "Any CPU" is if it is loaded into x64 and depends on assemblies that requires x86/32bit mode.
 
well, i gave my friend a program i made to test. using winsock. i gave him all the files necessary. and it just closes unexpectedly. so i figured because it wasnt compiled properly... i can be wrong.
 
well, i gave my friend a program i made to test. using winsock. i gave him all the files necessary. and it just closes unexpectedly. so i figured because it wasnt compiled properly... i can be wrong.
If there's is an issue with 32/64-bit it's more likely that you'll have to compile specifically for 32-bit, not for 64-bit. As JohnH says, if an app relies on 32-bit only libraries then it will fail on a 64-bit machine if it's compiled for Any CPU or for x64. One common example of this is the Microsoft Jet database engine, used to interact with Access databases, Excel files, etc. This is available in 32-bit only so an app must be compiled for x86 to work on a x64 machine.
 
i didnt quite explain my self that well... im running 32bit hes running 64bit. he has all the library files he needs.

he runs it and it fails. he runs in compatibility mode. it still fails. so im not quite sure why... thats why i was wonder how to compile in 64bit ONLY. not any CPU.
 
I think the reason it's failing is because you should be compiling it for x86 not x64. If it works fine on a 32Bit system but not a 64Bit system then trying to compile it for x64 ONLY will cause it to ONLY crash, every time.

This is what JohnH and jmc have been saying.
 
Personally i dont think you can compile a 64bit program on a 32bit, if you was on 64bit then im sure backward compatiblility would be easier, but going from a 32 to 64 i dont think so, also this may not be the problem, try and add a error catch in their to display in a messagebox, so you friend can send you the result, if your unsure about error catching look on the MSDN for a better explanation, hope this helps :)
 
oh well, i dont really know what x86 ment. i was assuming any CPU. but i wasnt sure. i dont even know where to set any cpu or the other settings at...
 
to be honst im not sure my self, but for further knowledge on this you could check out the MSDN see if any guides in their clear things up for you, hope you figure it out :)
 
HA. i used a different program. compiled in 64bit. got a error on winsock not registered. easy-ish to fix... i say that lightly. i just need to edit the registry. no big deal.
adding registry key now...

/cry its already there... WELL Now. i have a problem. but i did get farther then before...
 
lol i was gonna say To register winsock.ocx do this:
first copy winsock to the windows system directory.
Then
Start menu
run
regsvr32 c:\windows\system\winsock.ocx

the simple way, then i realised you said it was already their lol, hope you figure this out :)
 
Back
Top