Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make does not build SFML with gcc (Mac) #1229

Closed
naezith opened this issue May 7, 2017 · 12 comments
Closed

make does not build SFML with gcc (Mac) #1229

naezith opened this issue May 7, 2017 · 12 comments

Comments

@naezith
Copy link

naezith commented May 7, 2017

I successfully build my game in Windows and Linux with the latest SFML on GitHub. I installed gcc 4.9 from homebrew, to my Macbook Air with OS X Lion 10.7.5. I set everything up and ran cmake-gui, set the C, C++ and Fortran compilers to the gcc 4.9 ones. Configure -> Generate, all good.

Then I call "make", it runs normally just like in Windows or Linux, but then around 50% it fails with an error. And when I googled it, actually there was someone else who tried to do exactly the same thing in 2012.

https://en.sfml-dev.org/forums/index.php?topic=9761.0

It complains in all those NS... files. I really want to use the same Code::Blocks project I use for Windows & Linux, with gcc so please guide me on this.

@naezith naezith changed the title SFML does not compile with gcc on Mac make does not build SFML with gcc (Mac) May 7, 2017
@MarioLiebisch
Copy link
Member

No idea, but since those are Objective C, you might be missing the Objective C compiler for GCC? Or some environment variable?

@mantognini
Copy link
Member

This is not something that will be officially supported by SFML -- the rational being that you'll end up with more issues when shipping your program. Don't fight the system (too much).

@naezith
Copy link
Author

naezith commented May 11, 2017

I updated the OS to macOS Sierra 10.12.4. Everything went smooth when I installed latest Xcode and g++/clang++ of it. Stable as Windows, thanks for amazing stability.

@JonnyPtn
Copy link
Contributor

JonnyPtn commented May 12, 2017

Why would this not officially be supported? You're making an assumption that people will want to package what they build with SFML. What if it's a dependency for something else? Personally, I build everything on macOS using gcc/g++, and I know lots of people (especially coming from linux) do the same.

For the record, I don't have any issues using gcc/g++ on macOS, even when packaging things (I package just like I do on Linux) Just wanted to voice my opinion that it shouldn't be dismissed

@naezith
Copy link
Author

naezith commented May 12, 2017

It's pretty cool that I can use my "single" Code::Blocks project file for all three platforms.

@mantognini
Copy link
Member

@JonnyPtn Unless you installed a custom GCC, the one you have from Xcode is just a simlink to Clang. Apple chose to switch to a different "official" compiler a while back, probably to implement some custom features. If using GCC actually works, then fine. But I'd rather spend my time on other matter if that's not the case; "patching" SFML to support GCC or any other compiler is not really interesting. If you notice something broken with GCC and have some time to fix it, then we can discuss it, but unless someone from the SFML community decides to pitch in no effort will put into that. ;-)

@JonnyPtn
Copy link
Contributor

I know apple use clang as a default compiler, I choose to use gcc because it makes my life a little easier when porting (as OP and many others do too).

You may spend your time however you like, and I never expected you to patch SFML to support specific compilers, I just feel this was closed prematurely, especially when @MarioLiebisch was trying to help and was waiting on a response.

Do you close every request from a linux user who isn't using the official distro/compiler?

While we're on the subject, where is the official list of officially supported compilers/operating systems?

@mantognini
Copy link
Member

The issue being closed doesn't mean we cannot discuss about it. But if you want to discuss it, please follow our contribution guideline -- it helps a lot to know at which stage of discussion we are. The first step is always to discuss new bugs & feature requests on the forum.

where is the official list of officially supported compilers/operating systems?

Check out the tutorial, the requirements are detailed there.

@JonnyPtn
Copy link
Contributor

JonnyPtn commented May 12, 2017

I agree, guidelines weren't followed here. That wasn't how you initially responded to the issue though.

Check out the tutorial, the requirements are detailed there.

I may be blind, but where?

The issue being closed doesn't mean we cannot discuss about it.

I know, but it does mean when I'm looking for issues I can help with, I don't see it without poring through all the closed issues

@mantognini
Copy link
Member

https://www.sfml-dev.org/tutorials/2.4/start-osx.php:

Xcode (preferably version 4 or later of the IDE which is available on the App Store) and clang.

Is there something broken? From the above discussion it seems that the current solution works. If you have concrete issues we can discuss that provided you/someone want to provide a fix, but if it works I see no reason to keep the matter open. ;-)

@saxbophone
Copy link

This same issue tripped me up earlier today. From reading this thread, it appears that SFML doesn't support building with GCC on macOS. If this is indeed still the case, I think the CMake build instructions at https://www.sfml-dev.org/tutorials/2.5/compile-with-cmake.php could be improved a bit by mentioning this explicitly. The only part of the docs that suggests that native compilers should always be used is in a section which covers cmake-gui (not applicable on macOS so I overlooked it):

Always keep the "Use default native compilers" option enabled. The other three fields can be left alone.

I think either adding something to that tutorial page, or providing a complete list of OSes/compilers on which SFML is known to compile successfully (such as the list of those that build successfully in CI) could be an improvement.

Rationale

I've got a project on the go for which SFML may be a dependency. I test my projects on different compiler/OS combinations as an aid to portability (as is done by some other projects) so it's useful for me to know if a particular compiler on a particular platform is not supported.

Investigation

To determine if it wasn't just an issue with my machine, I added GCC to SFML's CI config in my fork. First off, it seemed the issue is caused by a flag being passed to GCC that only Clang understands (Github Actions build log: https://github.com/saxbophone/SFML/runs/1846062894?check_suite_focus=true), but once this was removed, it's clear that there's a much bigger amount of work that may need to be done to get SFML building on GCC/mac (Github Actions build log: https://github.com/saxbophone/SFML/runs/1846095210?check_suite_focus=true).

@eXpl0it3r
Copy link
Member

Duplicates #2790

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants