Mac OSX - Getting segmentation errors for every C ++ program (even Hello World) after updating Yosemite

Recently, I just upgraded to OSX Yosemite on my Mac, and although I'm not sure if this is the reason, it seems suspicious that all of my C ++ programs suddenly crack a segmentation error.

I even tried the basic of all the major Hello World programs, and I still get a segmentation error. Literally every C ++ program does the same.

#include <iostream> using namespace std; int main() { cout << "Hello World" << endl; } 

I installed Xcode updates to make sure this fixes the situation, but no luck. I am curious if anyone else has the same problem? Regardless of Yosemite, did you experience this problem when your Mac throws segmentation errors for everything ?

I have to add, I'm compiling with g ++

+8
c ++ xcode osx-yosemite macos
source share
2 answers

After several attempts, I found a workaround from here:

http://lists.gnu.org/archive/html/libtool-patches/2014-09/msg00002.html

Just

 setenv MACOSX_DEPLOYMENT_TARGET 10.9 

or

 export MACOSX_DEPLOYMENT_TARGET=10.9 

Happiness works after that. However, the correct bug fixes should come from libtool, so stay tuned there.

+11
source share

My g ++ version (MacPorts gcc47 4.7.4_5 + universal) 4.7.4

I ran sudo port selfupdate and then sudo port upgrade outdated

It worked for me

you can also run launchctl setenv MACOSX_DEPLOYMENT_TARGET 10.9 to make it permanent.

0
source share

All Articles