Sample Header Ad - 728x90

gcc14 (MacPorts) cannot handle stdio.h include

0 votes
1 answer
97 views
I am trying to compile (from source, I am aware that there is a port but I need to compile from source) a library (GKlib) with MacPorts gcc14 on Sonoma 14.7,3. MacPorts is up to date I have set thing sup with git clone https://github.com/KarypisLab/GKlib.git cd GKlib make config cc=gcc-mp-14 prefix=../GKlibInstall make make results in: /opt/local/bin/gcc-mp-14 -I/Users/gerben/RenskeDev/Leon/fromsource/GKlib/. -I/Users/gerben/RenskeDev/Leon/fromsource/GKlib/test -DLINUX -D_FILE_OFFSET_BITS=64 -std=c99 -fno-strict-aliasing -march=native -fPIC -Werror -Wall -pedantic -Wno-unused-function -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas -Wno-unused-label -DNDEBUG -DNDEBUG2 -DHAVE_EXECINFO_H -DHAVE_GETLINE -O3 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk -mmacosx-version-min=14.7 -MD -MT CMakeFiles/GKlib.dir/b64.c.o -MF CMakeFiles/GKlib.dir/b64.c.o.d -o CMakeFiles/GKlib.dir/b64.c.o -c /Users/gerben/RenskeDev/Leon/fromsource/GKlib/b64.c In file included from /Users/gerben/RenskeDev/Leon/fromsource/GKlib/GKlib.h:32, from /Users/gerben/RenskeDev/Leon/fromsource/GKlib/b64.c:20: /opt/local/lib/gcc14/gcc/x86_64-apple-darwin23/14.2.0/include-fixed/stdio.h:83:8: error: unknown type name 'FILE' 83 | extern FILE *__stdinp; | ^~~~ A test file (Hello World) in the directory above compiles fine. I’ve seen messages with this kind of trouble but I don’t understand exactly where this is going wrong. gcc14 has a 'translated/fixed' stdio.h from Apple (/opt/local/lib/gcc14/gcc/x86_64-apple-darwin23/14.2.0/include-fixed/stdio.h) that starts with: #ifndef _STDIO_H_ #define _STDIO_H_ #include #include __BEGIN_DECLS extern FILE *__stdinp; When testing with the test file (a simple Hello World), the culprit seems to be -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.2.sdk My guess is that I need to make sure make etc. add another -isysroot before the Apple SDK one. Is that correct (because then I have to find out how). It’s been far too long I have been doing stuff like this, so I could use tips. Thanks,
Asked by gctwnl (762 rep)
Feb 13, 2025, 10:34 AM
Last activity: Jul 15, 2025, 07:00 PM