CoreFoundation/CFString.h missing

Hello, I am trying to compile a different version of ruby using RVM but I keep getting the error message that <CoreFoundation/CFString.h> is missing. I've been searching for almost a week for a solution to this problem. Please reply with what information would be helpful so I can provide more information.


I have tried

xcode-select --install


I am on Mojave 10.14.4


I am using homebrew, and here is what happens when I type brew config:


ORIGIN: https://github.com/Homebrew/brew

HEAD: 1337da0f891aebb85accb094d63e401da1b53cba

Last commit: 6 days ago

Core tap ORIGIN: https://github.com/Homebrew/homebrew-core

Core tap HEAD: 893d2b0451b482af8ed944e04577d6e8a590f8f8

Core tap last commit: 9 hours ago

HOMEBREW_PREFIX: /usr/local

HOMEBREW_LOGS: /Users/nfgallimore/Library/Logs/Homebrew

CPU: dodeca-core 64-bit kabylake

Homebrew Ruby: 2.3.7 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby

Clang: 10.0 build 1000

Git: 2.17.2 => /Applications/Xcode.app/Contents/Developer/usr/bin/git

Curl: 7.54.0 => /usr/bin/curl

Java: 10.0.2, 1.6.0_65-b14-468

macOS: 10.14.4-x86_64

CLT: 10.2.0.0.1.1552586384

Xcode: 10.1

CLT headers: 10.2.0.0.1.1552586384


This is my stackoverflow post:


https://stackoverflow.com/questions/55525660/installing-ruby-2-3-1-on-mojave-osx-with-rbenv-or-rvm/55526292#55526292


The error occurs when I type


rvm install 2.3.7

Here is the make_log:



[2019-04-10 12:50:20] __rvm_make

__rvm_make ()

{

\make "$@" || return $?

}

current path: /Users/nfgallimore/.rvm/src/ruby-2.3.7

PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/sbin:/usr/local/opt/ruby/bin:/usr/local/opt/llvm/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/nfgallimore/bin:/Library/TeX/texbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/nfgallimore/.rvm/bin

command(2): __rvm_make -j12

++ make -j12

CC = gcc

LD = ld

LDSHARED = gcc -dynamiclib

CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -fno-common -pipe

XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT

CPPFLAGS = -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl@1.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin18 -I./include -I.

DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/libyaml/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libksba/lib -L/usr/local/opt/openssl@1.1/lib -install_name /Users/nfgallimore/.rvm/rubies/ruby-2.3.7/lib/libruby.2.3.0.dylib -compatibility_version 2.3 -current_version 2.3.7 -fstack-protector -Wl,-u,_objc_msgSend -framework Foundation -fstack-protector -Wl,-u,_objc_msgSend -framework Foundation

SOLIBS = -lpthread -lgmp -ldl -lobjc

Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1

Apple LLVM version 10.0.0 (clang-1000.11.45.5)

Target: x86_64-apple-darwin18.5.0

Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

translating probes probes.d

compiling main.c

compiling dmydln.c

compiling miniinit.c

compiling dmyext.c

compiling miniprelude.c

compiling bignum.c

compiling class.c

compiling compar.c

compiling complex.c

compiling dir.c

compiling dln_find.c

compiling encoding.c

compiling enum.c

. ./vm_opts.h

compiling enumerator.c

compiling error.c

compiling eval.c

compiling load.c

compiling proc.c

compiling file.c

file.c:23:10: fatal error: 'CoreFoundation/CFString.h' file not found

#include <CoreFoundation/CFString.h>

^~~~~~~~~~~~~~~~~~~~~~~~~~~

eval.c:776:8: warning: unused variable 'mid' [-Wunused-variable]

ID mid = me->called_id;

^

1 error generated.

make: *** [file.o] Error 1

make: *** Waiting for unfinished jobs....

1 warning generated.

++ return 2

Answered by nfgallimore in 356609022
The following command reinstalls the header files:
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Accepted Answer
The following command reinstalls the header files:
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

I see that this thread is several years old... I'm having the same problem now with Xcode 14.2 under macOS 13.1 Ventura. I've tried the terminal commands above with no luck.

xcode-select --install tells me that the command line tools are already installed -- which makes sense, since I installed the Xcode 14.2 command line tools separately after installing Xcode itself.

I downloaded command line tools for macOS 10.14 and ran "open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg" which ran an installer. After restarting my Mac, I still get the following error when compiling for a macOS 10.13 target:

'CoreFoundation/CFString.h' file not found

In Xcode settings > Locations I have the Command Line Tools set to Xcode 14.2, which is the only available option.

Targeting macOS 10.14 or higher works fine, but I also need a build for 10.13.

I don't know if this is related, but I also get an error in __config line 1123 'No thread API'

Any suggestions would be much appreciated.

CoreFoundation/CFString.h missing
 
 
Q