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

Author Topic: How to build CSFML i386 version on x86_64 Linux system?  (Read 7334 times)

0 Members and 1 Guest are viewing this topic.

mr.d

  • Newbie
  • *
  • Posts: 5
    • View Profile
How to build CSFML i386 version on x86_64 Linux system?
« on: June 26, 2013, 10:51:18 pm »
It is need for compartability with dmd D compiler - bug in 64 bit C ABI not followed for passing structs as function parameters:

http://d.puremagic.com/issues/show_bug.cgi?id=5570
https://github.com/Jebbs/DSFML/issues/27

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: How to build CSFML i386 version on x86_64 Linux system?
« Reply #1 on: June 28, 2013, 05:17:10 am »
It shouldn't be different from building it on any other system I would think.

You would have to build SFML from source first(you can follow the tutorial for that) and then you would  do more or less the exact same for CSFML. There are also a lot of different threads for building CSFML so you should have no problem finding information about it.

SFML CMake tutorial can be found here: http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php
« Last Edit: June 28, 2013, 08:13:35 am by Jebbs »
DSFML - SFML for the D Programming Language.

mr.d

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: How to build CSFML i386 version on x86_64 Linux system?
« Reply #2 on: July 04, 2013, 05:53:34 am »
It shouldn't be different from building it on any other system I would think.

You would have to build SFML from source first(you can follow the tutorial for that) and then you would  do more or less the exact same for CSFML. There are also a lot of different threads for building CSFML so you should have no problem finding information about it.

But I am not found any info about such crossplatform building...

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: How to build CSFML i386 version on x86_64 Linux system?
« Reply #3 on: July 04, 2013, 06:06:16 pm »
Isn't i386 just a different way of saying x86/32bit, right?(More or less)

What you really need to do is just force your compiler to compile CSFML as 32 bit shared libraries. You can do so by adding in the extra GCC switch "-m32" when you are generating the makefiles with CMake.

I don't have CMake on this computer, but I think you would add it to the CFLAGS field and then configure/generate and build like usual.
DSFML - SFML for the D Programming Language.

mr.d

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: How to build CSFML i386 version on x86_64 Linux system?
« Reply #4 on: July 05, 2013, 03:33:21 am »
I'm not found ability to add -m32 - after changing cmake config it builds 64 bit binary again.

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: How to build CSFML i386 version on x86_64 Linux system?
« Reply #5 on: July 05, 2013, 11:02:11 pm »
I have tomorrow off so I'll see if I can track down a way to get this working for you. Since this is a very inconvenient problem for the DSFML Linux users, there should be a little tutorial in the wiki anyways.
DSFML - SFML for the D Programming Language.

Jebbs

  • Sr. Member
  • ****
  • Posts: 358
  • DSFML Developer
    • View Profile
    • Email
Re: How to build CSFML i386 version on x86_64 Linux system?
« Reply #6 on: July 07, 2013, 03:08:42 am »
I have just added in a page on the DSFML wiki about how to get CMake to let the compiler know to build in 32bits. You can find it here: https://github.com/Jebbs/DSFML/wiki/How-To-Build-A-32bit-Version-On-Linux

I hope this helps! And feel free to let me know if you need any other information to get things working or if I wasn't clear enough.
DSFML - SFML for the D Programming Language.