Build tools broken after uninstalling Xcode - c++

When I use make to build my C++ project from the command line (cmake .., make) after installing and uninstalling xcode, make outputs make[2]: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++: No such file or directory
xcode-select -p output:
/Library/Developer/CommandLineTools
sudo xcode-select --install output:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
xcode-select --reset output: nothing
I uninstalled and reinstalled the xcode command line tools and it still gives the same No such file or directory error

CMake stores the results of its system introspection - the full path to the compiler used is one of them - in a file called CMakeCache.txt.
If you change something in your system that invalidates these results you need to clear the cache, i.e. delete the CMakeCache.txt file in the build folder.

Related

Change where I installed Cmake initially to usr/local/bin on mac

I am new to the computer and as I wanted to install Cmake instead of installing it in usr/bin or usr/local/bin I installed it in Users/Admin/Source!
Could you help me to figure out how can I change its directory or do I have to uninstall it completely?!
To install Cmake I followed the steps here http://mac-dev-env.patrickbougie.com/cmake/, except the first line.
Thanks
If you successfully went through the steps in the link you provided, cmake is now installed in /usr/local/cmake/bin.
(From what I understand you just did the download in another directory which is fine).
Since the tutorial also tells you to add this directory to your PATH it should be fine. i.e cmake should be accessible from anywhere after sourcing again your .bash_profile or simply opening a new terminal.
If for any other reason you need cmake to be in /usr/local/bin. you can create a symbolic link in this directory:
ln -s /usr/local/cmake/bin/cmake /usr/local/bin/cmake

Executing sudo make install in Eclipse CDT?

I'm contributing to OpenCV using Eclipse Neon.
I edited the Build command in Project->Proprieties->C/C++ Build->Build command as sudo make -j8 install, so when I build the project, Eclipse compiles OpenCV and then install it in my system.
However, this is the returned error:
sudo make -j8 install all
sudo: no tty present and no askpass program specified
I think that this is because sudo asks the password and Eclipse can't give it. How can I do this? I've found this [question][1] on the topic, but I didn't understood the given [answer][2]
Instead of using sudo use an alternative, which uses GUI, like gksudo on Gnome / LXDE or kdesudo on KDE.
If you want to use sudo, you have to put the line
john ALL = NOPASSWD: /usr/bin/make
into the file /etc/sudoers, where john is your user name and /usr/bin/make is the path to the make executable. With this line, you can start make with sudo, but without enter the credentials.
But instead of entering this line directly to /etc/sudoers, you should better call sudo visudo, which opens the sudoers file in an editor and if you close the program, it checks the changes you made on the file.

Installing c++ boost using cygwin: can't find configure file

I'm trying to install Boost for c++. Since I use cygwin (on Windows 7) I follow these instructions for Unix.
I start by downloading boost_1_55_0.zip from sourceforge. The instructions tell me to run tar --bzip2 -xf /path/to/boost_1_55_0.zip but this doesn't work (probably because the downloaded file is .zip and not .tar.bz2; I can't find the latter anywhere to download), so instead I use winrar and unzip it into /usr/local.
After this the header-only libraries work fine, but I need the ones where a build is necessary.
The instructions tells me to go to the boost folder and run./configure --help, but this doesn't work; I get the message -bash: ./configure: No such file or directory. So I locate the file configure in the folder /usr/local/boost_1_55_0/tools/build/v2/engine/boehm_gc, go there and try again, and this time it works: I get the help for configure.
I then try to run ./configure --prefix=/usr/local/boost_1_55_0 --enable-cplusplus but get the error message configure: error: cannot run /bin/sh ./config.sub. I try it with only one or none of the options too but that doesn't help.
Any ideas?
I don't know what guide you're following, but to install boost I have done:
cd boost
./bootstrap.sh
./b2
./b2 install
stop
As report boost doc:
If you plan to build from the Cygwin bash shell, you're actually
running on a POSIX platform and should follow the instructions for
getting started on Unix variants. Other command shells, such as
MinGW's MSYS, are not supported—they may or may not work.

make Error running CDT Eclipse on a Mac

I installed the CDT package via Install Software option in Eclipse, and after that, I installed the Command Line Tools using Xcode on my Mac. I am running Eclipse Juno on Mountain Lion.
After installing command line tools, I exported the paths with:
export CC=/usr/bin/gcc
export CC=/usr/bin/g++
In eclipse, I'm getting this error with auto-generated HelloWorld executable projects and autotools:
Error 127 occured while running autoreconf
make: *** No rule to make target 'all'.
From what I have found, the second has to do with g++, but I'm not really sure what the issue is.
I'd appreciate any help. Thanks.
Hopefully you've installed the XCode command line tools.
Also you might need to configure the project.
Ideally you invoke aclocal, automake --add-missing and then autoconf.
Then run configure and make. You might need the -i option for autoconf.

How do I install Audiere?

I'm trying to install PyAudiere (on MacOS 10.5), and it needs Audiere installed. I downloaded the Unix source from the Audiere website and ran configure and the makefile. I also tried adding audiere.h to the g++ include path with the command:
g++ -I /[...]/audiere-1.9.4/src audiere.h.
This did something, but I'm not sure what. When I try to install PyAudiere using
python setup.py install
it always says
error: audiere.h: No such file or directory.
Have I installed Audiere? If not, how do I do it?
Disclaimer: I know virtually nothing about mac OS
If you have run configure:
./configure
and the makefile:
make
Have you then run:
make install
Without running make install you have simply compiled the files but not installed them into your system. Under linux you might have to run sudo make install in order to get the administrative privileges required to install files.