Which compilers are supported on Linux?


#1

Hi,

Is it still documented somewhere which compilers are supported? On Linux that would be GCC and Clang I suppose.

I had to compile JUCE 4.2 on GCC 4.4:

First error below:

juce/modules/juce_core/native/juce_posix_SharedCode.h: In member function ‘bool juce::File::deleteFile() const’:
juce/modules/juce_core/native/juce_posix_SharedCode.h:418: error: ‘remove’ was not declared in this scope

That function remove is defined in <stdio.h>, but that header is not included. Does that actually compile on newer versions?

And in the SVG parser I had to move the classes used to call SVGState::XmlPath::applyOperationToChildWithID outside the function scopes to get it to compile. I’m assuming more recent compilers will handle this code as expected.


Roeland

(*) yes GCC 4.4 is old, but remember you can’t target older distributions when compiling on Linux, so upgrading is not always an option.


#2

so far I was only able to compile all examples from the distribuation with clang see link to my post here

One of the most preferred IDEs for use with JUCE on Linux seems to be Codelite in this forum. Might be one reason is as well it’s strong support for clang compiler which supports all the compiler flags used for the JUCE distribution examples.

BTW: Not all examples from the distribution have preconfigured Makefiles. It’s possible to generate them on a Mac or Windows and then compile on Linux.


#3

This should be fixed on the latest develop tip.


#4

Thanks, fabian.

Do you still have a list somewhere with which compilers you are testing? Or generally what the requirements are (like C++11 support)?


Roeland


#5

No, we don’t have such a list at the moment. C++11 is not a requirement.


#6

Yes, we don’t have an official list, but any GCC or Clang version from the last couple of years will be just fine. We’ll be making C++11 a requirement later this year, but for linux that’s not likely to be a problem for anyone.


#7

@jules it is going to be a problem especially on Linux. The “last couple of year” won’t cut it, not even close.

For Mac OS X and Windows it won’t be a problem because you can target older versions of the OS. Eg. on Windows 10 I think you can target Windows versions all the way back to Windows 2000. XCode on OS X has a target option as well.

On Linux on the other hand, the version of glibc, the kernel version and the GCC version are tightly coupled, and you can’t realistically target older Linux versions.

So for instance, the oldest fully suppored CentOS release is 6.7, which comes with glibc 2.12 and Linux 2.6.32. and GCC 4.4. Realistically, to compile a binary which should run on that version, the most recent compiler you can use is that particular version, GCC 4.4. If you’re releasing commercial software then you have to wait for another couple of years before upgrading to a newer compiler.

That particular version of CentOS will receive maintenance updates for another 4 years.


#8

You can just compile your own custom versions of gcc and clang. That’s very simple. I use a four year old fedora 17 computer to create binaries. Currently I use gcc 5.3 and clang 3.8 on that computer.


#9

Well the limiting factor is linking to whatever glibc version is available on these old distributions (version 2.12 on CentOS 5.6). We can try with GCC 4.8.2, which according to the internet will work.