I'm trying to install the command line tools on Code::Blocks on my Mac, i have downloaded Xcode and tried to install their command line tools, but i get this error when I try to enter Apple's download page:
I've even tried downloading from code block preferences , but i don't get the option to:
Any Suggestions?
My main aim is just to have a C++ compiler working on my Mac, and I'm aiming to start developing C++ applications. Any further suggestions on this alternatively to Code::Blocks would help.
Thanks
Download xcode and install their command line tools. All of the xcode tools are generally updated well and easy to install
Related
I need to install the Command Line Tools, in order to be able to compile Node C++ stuff.
Using xcode-select
Trying to use
xcode-select --install
Yields
Looking in Xcode's Preferences, Downloads
Trying to access the Downloads panel in Xcode
Version 5.0.2 (5A3005)
Yields
(no option to install Command Line Tools)
How the hell do I install these tools? Installing them by hand didn't help either
Two possible paths.
1)
Use the "Locations" pane in Xcode Preferences. You're looking for something like this:
2)
You can download the tools from Apple's website, where it's sitting:
Interestingly enough, the description for the Command Line tools lists a date, but not a compatible Xcode version. So the one I've opened up the disclosure triangle for is likely to be the one you want.
I get this error when I try to build a c++ project, however I can run cpp apps in Xcode, I've downloaded CDT for Eclipse, so the compiler must be installed.
echo $PATH:
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
I'm using Mac, I've found posts saying download gcc or Xcode, or solutions for Windows, it's very frustrating that I can't find the answer for such an easy problem, so please… How can I set the PATH variable for my cpp projects in Eclipse?
This question should help. It looks like you need to install XCode command line tools separately to use compilers and build systems outside of XCode (e.g. on the command line or in Eclipse).
Update:
I solved the problem in the end by reinstalling command line tools, as shown in this link.
Sorry for the trouble!
Initial question
I have just upgraded to OSX Mavericks and I cannot make the compiler work anymore.
I've been using gcc48 from macports with vim/sb2 and everything was working just fine. Now any library that I include gives tons of errors. I am not very experienced and I do not know what to do, or what to search for. I just want it to work like before. Here is what is says when compiling a basic "hello world" program:
In file included from /opt/local/include/gcc48/c++/bits/postypes.h:40:0,
from /opt/local/include/gcc48/c++/iosfwd:40,
from /opt/local/include/gcc48/c++/ios:38,
from /opt/local/include/gcc48/c++/ostream:38,
from /opt/local/include/gcc48/c++/iostream:39,
from ceva.cpp:1:
/opt/local/include/gcc48/c++/cwchar:44:19: fatal error: wchar.h: No such file or directory
#include <wchar.h>
If you need any information, tell me and I will provide it to you. Thank you for your patience!
[Added 2019 - Mojave/Catalina] XCode 10 has removed the placement of headers in /usr/include, even with the command line tools. If you want headers, and you're on you should be able to install a transitional package, which is available on Mojave. This package is not present on the Catalina. The headers are within the SDK for the appropriate release.
XCode 5/Mavericks have changed the defaults for where headers are located.
On prior versions of Mac OS X / XCode you would have found headers in /usr/include.
When you built gcc on the older release it picked up the headers from that location, and looks for them there now when you try to build code.
The problem is that the files are not there; they're somewhere under /Applications/Xcode.app/Contents/Developer.
You could futz about with a spec file to get it working consistently again, but the sanest thing to do is rebuild gcc.
As has been mentioned as well, you can install the command line tools using xcode-select --install, which will reinstall the developer tools, including the headers in /usr/include.
I tend to reinstall things like gcc when I upgrade my operating system as I encounter other errors due to changes in the environment. This is just a habit I've formed. It may not be the best habit, but it's saved me pain on numerous occasions.
[added 2017] As an addendum, if you install the command line tools, then the headers will be placed in /usr/include as well. The command to install the command line tools is xcode-select --install - this will allow you to use most compilers without having to specify the location of the headers manually.
This is how I got it working on Mac osx Mavericks:
Open terminal
type --> xcode-select --install
A pop-up windows will apear asking you about install tools
choose install tools
wait install to finish
Here is a manual method for updating XCode on OS X Mavericks:
Go into the developers site http://developer.apple.com
Then go to Downloads for Apple developers and there is a command line tools installer for Mavericks — here's the link (but you'll need a developers account for the link to work) http://developer.apple.com/downloads/index.action?q=xcode
I'm using MacOs Sierra 10.12.4, got the same problem.
I solved it by using:
/usr/bin/gcc
For me the fix was to uninstall old broken gcc:
brew uninstall gcc#5
I noticed paths like /usr/local/Cellar/gcc#5 in build output, while gcc#8 was also installed and is the one that was supposed to be used.
I am trying to build c++ xcode application from makefile.
I am using xcode 4.2, and in this version i dont see command line utility->standard tool.. All the help says "If you are just trying to build a command-line utility, selectone of the tools—for example, Standard Tool."
I have installed command line tools from preferences->downloads->components
Can some one help me on this?
You should have "Command Line Tool" available when starting a new project in "OS X"->"Application". If you don't, try updating your softwares, including XCode.
I am coding a computer vision program, which is using OpenCV 2.4, by Xcode 4.4. I want to compile and make it in the Terminal by g++ or make command. But the system shows a lot of errors that the compiler cannot find the "opencv2/opencv.hpp" file and Vec3d, etc..!
My question is how to configure the system the I can make and build the code in Terminal? Thanks.
First, you need to have command line tools (I guess you already have it)
Bring up Preference in Xcode
Select "Downloads" tab
Select "Components' tab
Click 'install' on the command line tools line.
Then, you need to install OpenCV. I suggest to use Homebrew
setup homebrew, then
brew install opencv
It will install library in /usr/local, which is in g++'s standard lookup path, thus should be ok.
If you still need help, post the log file.