After doing exhaustive search, I finally fixed the issue in my Mac OSX 10.14.1 Mojave. The steps are as follows:
- If you use brew then do the following to update GCC:
- brew update
- brew doctor
- brew uninstall gcc
- brew install gcc
- Remove existing CLT (Command Line Tool) using: rm -rf /Library/Developer/CommandLineTools
- Install CLT: xcode-select –install
- Goto: /Library/Developer/CommandLineTools/Packages and double click to install macOS_SDK_headers_for_macOS_10.14.sdk.
- If you project using cmake then clear the cache.
- Rerun the make file and enjoy!!:)