Unable to run c/c++ code on OS X 10.9 - c

For some time now I have been unable to run c or c++ code on my Mac running OS X 10.9. See my earlier post for details on what I tried to do about this originally some time ago:
In Xcode running such code gives me the error: "clang: error: linker command failed with exit code 1 (use -v to see invocation)", which leads me to believe that it is some problem with clang symlinking to gcc, but I am not sure. I have already tried reinstalling OS X to no avail. Is there a way that I could reset everything related to running c/c++ code short of doing a clean install of OS X and manually restoring my files and apps? This has become very frustrating and it seems that there are no answers! Thanks.

Related

'gcc' could not be spawned. Is it installed and on your path?

'gcc' could not be spawned. Is it installed and on your path? If so please open an issue on the package spawning the process.
Facing this error in Atom editor while compiling C++ program with gpp extension. And I am using Ubuntu, and this error comes every time I compile C, C++, C#, Ruby, etc.
I have tried to change directory, and path too. But nothing happens. I tried different extension to compile but this same issue I am facing again and again.
I just installed Atom and performed 'Hello World' program of C, just to check that this is working or not but it's not.
I just except to get perfect output of program, well it's just Hello World. But one thing I wanted to say that this same problem i faced recently in Windows. But in Windows I changed 'PATH' then is got solved but I don't know anything about Ubuntu so I don't know what to do.
This means you haven't GCC installed in your distro.
Install GCC from here https://gcc.gnu.org/wiki/InstallingGCC

GDB on Mac OS Sierra, trying to uninstall and remove all files completely but can't

I should preface this by stating I'm working with Xcode on macOS Sierra 10.12.6.
I installed GDB with homebrew and it appeared to install fine until I tried to use it. In terminal it kept saying that it was not a valid command. (I'm new to C and was working with my professor. Even he was baffled when I tried to use it after downloading it in front of him). So later I tried to install it by creating the make file and still having problems. I then used homebrew again but to uninstall and reinstall, still having problems.
Now I'm at the point where I can't even run my C files when I use gcc to compile them. I simply get a statement that unable to open file. I've read someone suggest to sudo mv /usr/local /usr/_local and I'm notified that I don't have permission, even after entering in my password.
I've gotten every error when I try to remove all items belonging to gdb. I've gone as far as removing Xcode in hopes that I can do a fresh install of it all.
I'm at the point where I've begun looking into removing my macports entirely.
I'm looking for any advice into how I can try to start off from a clean slate. I need to use gdb on a project that is due and can't get this up and running. Please help talk me from a ledge!
EDIT:
I have used Sublime to create a simple Hello World file and it compiles and runs fine with gcc. So my project file has become corrupted somehow. At least I can calm down a bit. But I would still like to get this gdb issue figured out and install a fresh copy with everything old removed.
I'm working with Xcode on macOS Sierra 10.12.6
I need to use gdb on a project that is due and can't get this up and running
I don't know how to reinstall gdb on macOS, but be aware that gdb is broken on macOS Sierra as of now (at least debugging dynamic libraries), see Bug report.
So if you even get gdb correctly installed you can probably end up with nothing (gdb won't be able to debug what you want).
Try making your file executable using gcc -Wall -g $fileName.c -o $fileName. This will show all the errors that might exists. Secondly, if it doesn't work and you absolutely need to use gdb, using a VM of Linux(recommend Ubuntu if you're new to Linux or Mate) is a good alternative. You then have to just use sudo apt-get install gdb and even install gdb-dashboard git-hub gdb-dashboard if you want to do some serious debugging. That's the quickest fix that I can think of you are in a hurry. Btw good VMs are VirtualBox and Parallel Desktop(if you want to have access to your local files from the VM).

Yocto Build - loadlocale.c #130

So I've upgraded to a newer version of Linux kernel using Yocto. The new kernel version is for 4.1.15 and runs on an iMX6 chip. I've also included openssh-server, tools-sdk, and tools-debug for development recipes. The problem is that when I connect to build I get the following error:
loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof
(_nl_value_type_LC_COLLATE) / sizeof (_nl_value_type_LC_COLLATE[0]))'
failed
Now if I type into the command prompt sh -c "LANG=en_US" I get the same error as above. If I type in sh -c "LANG=/usr/lib/locale/en_US" then I do not get an error. When I type locale everything is listed as POSIX and when I type locale -a I get:
C
POSIX
en_GB
en_US
The last two are stored under /usr/lib/locale. My version of gcc is 5.2 and my glibc is v2.22. I've looked all over the internet for other solutions but they are either for Ubuntu where the package manager comes in handy or it's some really specific fix like editing a file that I don't have in my Yocto build.
Edit:
The machine is for a SMARC-FiMX6 SoM and the instructions are here. I'm not sure what branch of Yocto is being pulled down.
After troubleshooting the problem is from the glibc library. A patch, #114739, is on the openembedded website which details what to do to fix this issue. Just patch the file, rebuild, and the issue is fixed. See here for details, the patch is at the bottom of the page.

Can’t find C header files on Mac OS X

I upgraded to Yosemite, and now all my compilers (from the command line—gcc and icc) are giving me errors like: cannot open source file “ctype.h"
Does anyone know how to fix this? Do I need to reinstall the compilers?
OK, not sure what’s going on here, but after updating to Xcode 6.1.1 and installing the associated command line tools, icc seems like it can now find the system headers. Now having a separate issue with gcc, will post separately…

Problems building libmemcached on Mac OSX (and Mint, and CentOS)

Downloaded the tarball from https://launchpad.net/libmemcached/+download/libmemcached-1.0.12.tar.gz (linked to from libmemcached.org). Ran the usual ./configure + make protocol, got a number of errors related to implicitly converting 64-bit value to 32-bit, and eventually a failure to find event.h.
Earlier, tried installing on Mint (./libtool: line 1125: g++: command not found) and CentOS (./libmemcached-1.0/memcached.h:46:27: error: tr1/cinttypes: No such file or directory)
I'm not too bright when it comes to debugging this, but I'm very used to ./configure + make "just working". Anybody able to help?
Thanks,
Chap
I meet it yet. And, I found it :
https://github.com/mxcl/homebrew/issues/20635
In the page, the error been found is a libmemcahed bug that had been report as https://bugs.launchpad.net/libmemcached/+bug/1216521

Resources