Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Project compiled on 64 bit system running on 32 bit systems?  (Read 4641 times)

0 Members and 1 Guest are viewing this topic.

heishe

  • Full Member
  • ***
  • Posts: 121
    • View Profile
Project compiled on 64 bit system running on 32 bit systems?
« on: December 14, 2010, 07:00:48 pm »
When I compile a project that uses SFML on a 64 bit system (obviously using libs and dll's that were compiled on the 64 bit system too), can I distribute the program together with the 64 bit dll's and it will run on 32 bit system? Or do I have to distribute it together with the 32 bit dlls? Or do I have to compile the entire project on a 32 bit system and distribute 2 different versions of the program?

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Project compiled on 64 bit system running on 32 bit systems?
« Reply #1 on: December 14, 2010, 07:50:32 pm »
You cannot give a 64-bits app to a 32-bits OS – it won't understand a thing.
(But a 64-bits OS understand (most of the time) what is a 32-bits app.)

And you may not be able to mix 32-64-bits app/dll. (I've never tried but it seems not good to me.)
SFML / OS X developer

heishe

  • Full Member
  • ***
  • Posts: 121
    • View Profile
Project compiled on 64 bit system running on 32 bit systems?
« Reply #2 on: December 14, 2010, 08:29:40 pm »
weird though. 64 bit and 32 bit systems aren't different like... at ALL. the only way they differ is the address bus length in the CPU, and obviously the lengths of the amount of bits in the ALU etc.

and unless you're using 64-bit constructs within your program (which I'm not), I don't understand why it wouldn't run on a 32 bit machine.

after all, the addresses on the ram that are addressed in the code are the same as in 32 bit, as long as I'm just using <~3.5 gb of data, after which they exceed the range and are full 64 bit. as of right now, the adresses are in 64 bit in a 64 bit program, but half of the bits are just zeros.

very weird.

edit: might it be that on a 64 bit system, the 32 bit floats are different too? as I remember it, 32 bit floats are something like 1bit signed/unsigned, 9 bit char, and rest mantissa. that might create problems.

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Project compiled on 64 bit system running on 32 bit systems?
« Reply #3 on: December 14, 2010, 10:16:01 pm »
Well, I don't know all the stuff about it (yet) but maybe a 64-bits capable CPU has some kind of optimization for 32-bits OS so it may disable some stuff (two ALU maybe ? because int mult and add wouldn't be the same).

Moreover if you have an old computer which doesn't support at all 64 bits how would be some binary stored int looks like ? You'll get some weird results so it might be prevented by the OS (I hope so!).

BTW 32-bits float (aka IEEE 754) is 1/8/23 partitioned .  :wink:

EDIT : typo
SFML / OS X developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Project compiled on 64 bit system running on 32 bit systems?
« Reply #4 on: December 14, 2010, 10:50:35 pm »
The actual machine instructions/assembly works differently too. Also have extended instruction set if I'm not mistaken. Though might be wrong, was long time ago since we touched this topic at the university. Probably also 64bit got larger registers or more.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Project compiled on 64 bit system running on 32 bit systems?
« Reply #5 on: December 15, 2010, 03:10:15 am »
So if I am using a 64 bit system then there is no way to deploy my files to all the other guys with a 32 bit system? Crap.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Project compiled on 64 bit system running on 32 bit systems?
« Reply #6 on: December 15, 2010, 07:58:51 am »
You just have to compile as 32 bits. I think most compilers support this feature.
Laurent Gomila - SFML developer

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Project compiled on 64 bit system running on 32 bit systems?
« Reply #7 on: December 16, 2010, 12:16:33 am »
Quote from: "Laurent"
You just have to compile as 32 bits. I think most compilers support this feature.


So is win32 compiling, compiling for32 bit OS's? Because I tried to distribute to 32 bit xp's from my win7 64 bit and I included the dll's I think I needed and it said configuration incorrect.

ratzlaff

  • Newbie
  • *
  • Posts: 33
    • View Profile
Project compiled on 64 bit system running on 32 bit systems?
« Reply #8 on: December 16, 2010, 01:27:15 am »
Quote from: "Fierce_Dutch"
Quote from: "Laurent"
You just have to compile as 32 bits. I think most compilers support this feature.


So is win32 compiling, compiling for32 bit OS's? Because I tried to distribute to 32 bit xp's from my win7 64 bit and I included the dll's I think I needed and it said configuration incorrect.


Use Dependency Walker to determine if you are sending the right dll's

Fierce_Dutch

  • Full Member
  • ***
  • Posts: 138
    • View Profile
Project compiled on 64 bit system running on 32 bit systems?
« Reply #9 on: December 17, 2010, 02:39:01 am »
Quote from: "ratzlaff"
Quote from: "Fierce_Dutch"
Quote from: "Laurent"
You just have to compile as 32 bits. I think most compilers support this feature.


So is win32 compiling, compiling for32 bit OS's? Because I tried to distribute to 32 bit xp's from my win7 64 bit and I included the dll's I think I needed and it said configuration incorrect.


Use Dependency Walker to determine if you are sending the right dll's


I do, and i sent them lol.

 

anything