Using Macports' gcc8 to build C programs and libraries

Chris Jones jonesc at
Mon Apr 1 09:25:08 UTC 2019


One obvious question is why do you need to use gcc to build these c 
sources ? Is there an issue preventing you from using the main clang c 
compiler ? If you wish to support running this application on macOS, 
then I would suggest making it build with the default macOS compiler, 
clang, would be the best way to go.

cheers Chris

On 01/04/2019 10:10 am, Sean Lake wrote:
> Hello Macports Users:
> I have a collection of libraries I use in running simulations, and I
> recently moved from Fink to Macports to support a Mojave machine. I'm
> trying to build the libraries using my installed gcc8, but I'm running
> in to errors like:
> In file included from MWReddening.c:1:
> /opt/local/lib/gcc8/gcc/x86_64-apple-darwin18/8.3.0/include-fixed/math.h:45:10:fatal
> error: sys/cdefs.h: No such file or directory
>   #include <sys/cdefs.h>
>            ^~~~~~~~~~~~~
> Looking for similar errors on the web, I get pages like this
> that recommend installing a libc package. Will a similar solution work
> in Macports? If so, which package(s)? If not, will modifying my CFLAGS
> and LDFLAGS suffice? Currently, I have included "-I/opt/local/include"
> in CFLAGS and "-L/opt/local/lib" in LDFLAGS, but that's obviously not
> enough (or wrong).
> Thanks,
> Sean Lake

More information about the macports-users mailing list