SFML community forums

Bindings - other languages => C => Topic started by: mr.d on June 26, 2013, 10:51:18 pm

Title: How to build CSFML i386 version on x86_64 Linux system?
Post by: mr.d 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
Title: Re: How to build CSFML i386 version on x86_64 Linux system?
Post by: Jebbs 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
Title: Re: How to build CSFML i386 version on x86_64 Linux system?
Post by: mr.d 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...
Title: Re: How to build CSFML i386 version on x86_64 Linux system?
Post by: Jebbs 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.
Title: Re: How to build CSFML i386 version on x86_64 Linux system?
Post by: mr.d 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.
Title: Re: How to build CSFML i386 version on x86_64 Linux system?
Post by: Jebbs 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.
Title: Re: How to build CSFML i386 version on x86_64 Linux system?
Post by: Jebbs 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.