Mac cmake: 'stdio.h' file not found - macos

I have been stuck on this for a while, and I was wondering if I could get some help.
I'm currently stuck trying to run a cmake setup file and I'm constantly getting this error
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:15: fatal error: 'stdio.h' file not found
I've been looking online, and haven't been able to find anything recent. I've tried using the xcode-select --install already.
cmake version is currently 3.21.3.
The library I'm trying to install is https://github.com/google/draco, where I'm trying to install python functions using pybind11. I was able to install this library through cmake, whoever when I try to install the pybind11 functionality I keep getting this error. This library seemed to function properly on a coworkers linux machine, and they were running cmake 3.20.4 on ubuntu 18.04 (I don't know if this makes a difference)
Any help would be appreciated, and please let me know if there's any other information that can help the process.

It looks like something in XCode has changed after updating MacOS to 12.3. I had to reinstall XCode command line tools. I don't say it's right solution, but it works for me.
Commands for reinstalling (from https://stackoverflow.com/a/47804075):
removing the old tools ($ sudo rm -rf /Library/Developer/CommandLineTools)
install xcode command line tools again ($ xcode-select --install).

Related

Homebrew doesn't install GCC correctly

I recently upgraded xcode command line tools to version 2384. After this I decided to reinstall gcc which was installed with homebrew. Installation completed with no errors but when I tried to compile a simple code with iostream library, it gave an error saying:
/usr/local/Cellar/gcc/10.2.0/include/c++/10.2.0/cwchar:44:10: fatal error: wchar.h: No such file or directory
Later, I checked the library folder and there were multiple files missing such as assert.h. I want to ask is there any way to fix this other than installing every file one by one? I already tried updating homebrew and xcode command line tools.

Brew install on Mojave

I did these steps:
Updated to Mojave
Installed Xcode 10 beta3
Ran this command: sudo xcode-select -switch /Applications/Xcode-beta.app/
Now I'm trying to install node8:
brew install node#8
And it gives me this error:
Error: The Command Line Tools header package must be installed on Mojave.
The installer is located at: /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
Still, doing
install -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
does nothing, since there's no such file in my system. Where could I get it?
Go to /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg location and install package manually. And brew will start working.
I want to try and answer this question and also for those that come later that installed Mojave and had an older Xcode version installed. The process is the same minus that if you have Xcode 10, you don't need to install it again from my understanding.
The folder is hidden and was not accessible even with a sudo find command, however, I figured out that copying the absolute path and then pasting it in your browser address bar will give you the download and access to the folder that you need to fix brew install.
I posted a video here- https://youtu.be/GfnhSirTCGM that walks you thru part of my steps above. After you do the SDK headers download, its likely that unless you already are running Xcode 9.4, you will need to visit, https://developer.apple.com/download/more/ and look for Xcode 9.4 to install. Also grab the 10.14 command line tools as well. The lesson that should be learned here is that Apple calls it "Beta" for a reason and if you are a developer that knows the pains of setup, it is a bad idea. I hope that I was helpful! The last thing is, INSTALL XCODE THEN COMMAND LINE TOOLS-IN THAT ORDER OR IT ERRORS OUT! and then we do this all over again. Cheers!
It appears as though Apple has released a patch for the bug and it is available through the system preferences. 14 July 2018
Broken command line tools:
Xcode Location on the Apple developers website:
Location of command line tools:
Do not install Xcode from the Mac App Store because a different version is required!
Command line tools 10.14 update:
As of October 2018, the solution for making brew and brew install succeed is to:
install latest Xcode fom AppStore
run Xcode and install command line tools
add the line before to your profile or somethign similar
export CFLAGS="-I/usr/local/include -L/usr/local/lib -I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include"
No need to download Xcode manually, but you may want to remove the beta version if you installed it.
The magic part is at the end, where xcrun obtains the correct location of the SDK.
In terminal, you should first input the commands below
cd /Library/Developer/CommandLineTools/Packages
open .
you will open the directory on desktop,
then double click the pkg file to install it.

ld: library not found for -lvtkftgl

I'm trying to compile pcl program and I already done the installation of pcl using homebrew. I'm using Mac OSX 10.10.5 and command line to compile the program. At "make" step I got this error
ld: library not found for -lvtkftgl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
what could be the problems, and possibly solutions. I really appreciated it if anyone help me with this. Thanx in advance.
You can also install the latest PCL version.
brew install --HEAD pcl
So I had this issue as well; seems like the VTK library does not work well with pcl at this moment. A temporary solution is to install pcl without the VTK library, and you can compile and run their tutorial fine.
Run the following:
$ brew uninstall pcl
$ brew install pcl --without-apps --without-tools --without-vtk --without-qt # this will take a while, so be patient here
Now, follow the tutorial here: http://www.pointclouds.org/documentation/tutorials/using_pcl_pcl_config.php#using-pcl-pcl-config
You should be able to compile and run their tutorial fine.
Here is a temporary fix:
brew uninstall pcl
brew install https://raw.githubusercontent.com/ahundt/homebrew-science/vtk6/vtk6.rb --build-from-source
brew install https://raw.githubusercontent.com/ahundt/homebrew-science/vtk6/pcl.rb --build-from-source
Here is a discussion of this particular issue:
https://github.com/mikepurvis/ros-install-osx/issues/32
Here is where I'm trying to submit my fix to homebrew-science. Feel free to encourage them to break the particularly esoteric impasse that's occurring there!
https://github.com/Homebrew/homebrew-science/pull/3512

Trying to Run middleman on mac

Answering my own question for anyone else having this issue. (using the search terms i thought of because they didn't bring up the answers for me).
Trying to install and run middleman following the getting started guide on their website with Mac OS X 10.9.2. When trying to run bundle install getting errors about openSSL and event machine.
Gist of Errors.
Refrence to an answer that someone on IRC helped me find.
Aparently this is caused by a mismatch in expected versions with something called Clang which is part of the Xcode tools for mac. The update to Xcode tools causes this to fail. Using the command:
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future bundle install
seems to work to resolve this issue.

Problem installing node on Mac OSX 10.6.7

I'm getting this error when I try and install node on my new mac
error: could not configure a cxx compiler!
The error always occurs when I get to the ./configure part of the installation
I found this problem which applies to a linux build with the same error, but the solution does not seem to apply in my case:
How to compile/install node.js(could not configure a cxx compiler!) (Ubuntu).
I also took a look at the troubleshoot guide on the node wiki here:
https://github.com/joyent/node/wiki/Troubleshooting-Installation
and tried this solution:
export PATH=/Developer/usr/bin:$PATH
ISYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
export LINKFLAGS=$ISYSROOT CXXFLAGS=$ISYSROOT CFLAGS=$ISYSROOT
./configure --prefix=$HOME --without-ssl
make
But I get the same problem when I get to the ./configure step
Any advice, insights or help would be much appreciated here.
Thanks
When you install Mac OS X Developer Tools (XCode, etc) ensure you have the Unix Tools option checked. I had to remember to install Developer Tools/Unix tools when I set up my new MBP and it resolved this error for me.
Optionally, you could remove and try installing with Homebrew. However, it still has the same requirements (XCode/Dev Tools) so ensure that you have those installed.
Hope this helps.
I had this problem too, I resolved this in a different way, as far as I know xcode 4.3.1 doesnt come with an Install Xcode.app file from the appstore, if you are under this case, just run xcode, go to preferences -> downloads and click on the Install button for the command line tools option. I did just that and all the errors on the .configure and make commands were gone :)
I had the same problem on OSX 10.7 with Xcode 4.2. I was trying to build node v0.4.7. I kept getting "unable to configure a c compiler" error. What finally worked for me is installing the GCC compiler seperately. I found a nice package for that here:
https://github.com/kennethreitz/osx-gcc-installer/
configure is currently broken for some versions of MacOS; for more details, see How to compile Node.js v0.4.2 on MacOS 10.5.8. The working approach cited there is as follows:
export PATH=/Developer/usr/bin:$PATH
ISYSROOT="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
export LINKFLAGS=$ISYSROOT CXXFLAGS=$ISYSROOT CFLAGS=$ISYSROOT
./configure --prefix=$HOME --without-ssl
make
This worked for me .
Al
After installing XCode 4.3.2 (in Mac OS X Lion) I still had the error.
Open XCode, Preferences, Downloads and installed Command Line Tools.
After it gets installed ./configure runs ok.

Resources