> ## Content Index
> Fetch the complete content index at: https://developerinsider.co/llms.txt
> Use this file to discover other available public pages before exploring further.

# Fix Xcode 15 DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead
- URL: https://developerinsider.co/fix-xcode-15-dt_toolchain_dir-cannot-be-used-to-evaluate-library_search_paths-use-toolchain_dir-instead/
- Published: 2023-09-20T04:59:42.000Z
- Updated: 2023-10-17T04:53:14.000Z
- Author: Vineet Choudhary
- Tags: Xcode15, DT_TOOLCHAIN_DIR, TOOLCHAIN_DIR, Cocoapods, Xcode

In Xcode 15 Apple changed the variable which points to the default toolchain location to `$TOOLCHAIN_DIR` from `$DT_TOOLCHAIN_DIR`. If some project/target used `$DT_TOOLCHAIN_DIR` then it need to be replace by `$TOOLCHAIN_DIR`.

## 1\. Find DT\_TOOLCHAIN\_DIR Reference

To find out where in your project you are using this, you can search for `DT_TOOLCHAIN_DIR` in your project to find out where in your project you are using `DT_TOOLCHAIN_DIR`.

![](https://cdn.developerinsider.co/images/xcode/15/DT_TOOLCHAIN_DIR-search-result.webp)

## 2\. Fix for CocoaPods

If you are seeing only CocoaPods (`pod`) project is using `$DT_TOOLCHAIN_DIR` then you can add the following script in your Podfile to automatically update `$DT_TOOLCHAIN_DIR` to `$TOOLCHAIN_DIR`. This will only execute on Xcode 15 or later. It will not impact other developers who is using Xcode 14.

```rb
post_install do |installer|
	xcode_base_version = `xcodebuild -version | grep 'Xcode' | awk '{print $2}' | cut -d . -f 1`

	installer.pods_project.targets.each do |target|
		target.build_configurations.each do |config|
			# For xcode 15+ only
			if config.base_configuration_reference && Integer(xcode_base_version) >= 15
				xcconfig_path = config.base_configuration_reference.real_path
				xcconfig = File.read(xcconfig_path)
				xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
				File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
			end
		end
	end
end

```

## 3\. Fix for your project

If you see some references of `DT_TOOLCHAIN_DIR` in your main project/taget, then you need to update that manually.