• 0

Confusion 64bit OS and Developing 32bit Apps


Question

Hey guys, I was wondering if you guys could help me out here with some confusion about 64bit OS which i'm not very familiar with.

I was thinking of using 64bit OS platforms recently to make the most of my 4gb RAM which doesn't get fully used in 32bit OS but I am wondering what the impacts are in terms of any software development that I do?

I am currently developing a project but not sure what would happen if I develop under a 64bit environment, as in I want my project to be 32bit, if I develop in a 64bit OS would my project be affected in anyway, as in would it get compiled and built as a 64bit application instead of 32bit?

Also another short question not programming related but do 32bit apps work in 64bit OS?

These may be silly questions i'm asking but I have no experience at all with 64bit platforms and have never really taken it seriously enough to look into it.

Any help is greatly appreciated,

thanks.

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

You neglect to mention which platform and language you're using, but C/C++ on Windows with Visual Studio it's as simple as selecting the architecture (32-bit, 64-bit) from a drop-down list and hitting build. If you pick 32-bit, your program will be compiled as 32-bit. If you pick 64-bit, it will be compiled as 64-bit.

If you're building .NET code, you can build agnostic code that will be dynamically compiled to either 32-bit or 64-bit by the framework when the user runs the program.

Link to comment
Share on other sites

  • 0

There is no relationship between the environment your tools operate in and what stuff they generate in the end. In many scenarios, such as embedded development, cross-compilation (where a compiler running on architecture A generates code that runs on architecture B) is the norm. In the case of Windows, all of Microsoft's compilers are 32-bit, but depending on which compiler gets used (see hdood's post above), the output from that compiler may be x86-32, x86-64, or IA-64. IOW, changing your development machine to 64-bit should have no effect whatsoever on code generation on Windows (of course, running and testing your program would be a different story), and this probably holds true for other platforms as well.

Link to comment
Share on other sites

  • 0

Thank you for the replies, that helps greatly and clears some confusion.

As for the platforms, I will be running windows and linux, for the windows part I think i'm fine if visual studio allows me to change between 32 bit or 64 bit and if OS platform as no effect on the tools then with Linux (ubuntu) i'm guessing I should be safe if my tools by default generate 32bit, i'm thinking of using codeblocks IDE and maybe I similiar options for 32bit or 64bit comilation.

As for the language i'm using C++ and don't have much experience with .NET framework but i'm quite interested since hdood mentioned about the dynamic compilation into 32bit or 64bit.

Link to comment
Share on other sites

  • 0

another thing you can do if you want the dynamic compilation of 32/64 bit is to create your own installer and include both code sets, find out what version of the OS the person is using, and install the appropriate version of the software.

Wesley

Link to comment
Share on other sites

  • 0

as some other people said, the platform you use to develop doesn't matter. You could develop and compile a Windows app on Linux (but you couldn't run it on Linux without something like WINE)

Link to comment
Share on other sites

  • 0

Wouldn't it be useless to develop applications that wont be able to take full advantage of what 64 bit offers? Like does it make sense to develop an app like Windows Live Messenger as a 64 bit application?

Link to comment
Share on other sites

  • 0
Wouldn't it be useless to develop applications that wont be able to take full advantage of what 64 bit offers? Like does it make sense to develop an app like Windows Live Messenger as a 64 bit application?

I don't actually develop any 64bit applications and hence not familiar with it, I was just planning on migrating to a 64bit OS (windows and linux ubuntu) to take full advantage of my RAM.

Does anyone know if there are similar options to switch between 32bit and 64bit compilation in Linux? perhaps using codeblocks or gcc compiler or any other tools?

Mainly because i'm quite interested by Deadeye550's reply above on using a installer to install 32bit or 64bit depending on platform or perhaps option for both.

Link to comment
Share on other sites

  • 0
Does anyone know if there are similar options to switch between 32bit and 64bit compilation in Linux? perhaps using codeblocks or gcc compiler or any other tools?

Easy. Pass -m32 for 32bit and -m64 for 64bit to gcc. Just remember, if you want your code to be portable between Linux and Windows, bear in mind that Windows uses LLP64 for it's programming model whereas everyone else uses LP64.

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.