Difficulty compiling, possibly related to homebrew gcc?

Mac OSX specific forum
void
Enthusiast
Enthusiast
Posts: 116
Joined: Sat Aug 27, 2011 9:50 pm
Location: Washington, USA

Difficulty compiling, possibly related to homebrew gcc?

Post by void »

Today I decided to work on a gui utility for a personal task, and naturally I thought to use purebasic because it's so much easier to get simple gui applications working than in other languages I deal with.

But when I attempted to compile from a work-in-progress I had open from some months ago, I got this error:

Image

Research suggests it might because I currently have an actual gcc installed via homebrew, due to the need to compile other software (which does not compile correctly with clang).

Is this actually the problem? If so, is there a way to get purebasic to use the tools it expects without having to uninstall the homebrew installed gcc?

If not, what else might be the cause of this?
User avatar
mk-soft
Always Here
Always Here
Posts: 5335
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Difficulty compiling, possibly related to homebrew gcc?

Post by mk-soft »

I don't known...

Perhaps help

Code: Select all

ImportC "-stdlib=libc++" :EndImport
Or switch tools...
xcode-selection

sudo xcode-select -s /Applications/Xcode-91/Contents/Developer/

sudo xcode-select -s /Applications/Xcode/Contents/Developer/

xcode-select --install # Install Command Line Tools if you haven't already.
sudo xcode-select --switch /Library/Developer/CommandLineTools # Enable command line tools
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
void
Enthusiast
Enthusiast
Posts: 116
Joined: Sat Aug 27, 2011 9:50 pm
Location: Washington, USA

Re: Difficulty compiling, possibly related to homebrew gcc?

Post by void »

I already have xcode command line tools installed. I've successfully used purebasic on this computer in the past, just not in the last few months.

The only change I'm aware of that has happened since I last used purebasic is that I've had to install an actual gcc through homebrew in order to get other projects working correctly, but as far as I can tell it appears that with a real gcc in the path purebasic ends up using that rather than what is provided by xcode (which is really clang, and not gcc).

The "Import" line suggested by mk-soft just doubles the error. According to my research, the problem is the specific parameter being passed by purebasic to "gcc" is not actually supported by gcc, only by clang.
jack
Addict
Addict
Posts: 1336
Joined: Fri Apr 25, 2003 11:10 pm

Re: Difficulty compiling, possibly related to homebrew gcc?

Post by jack »

I suggest that you set the environment variable PATH to something like export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
I have gcc installed and made a link on the desktop to .profile so I can easily make changes if needed.
Post Reply