Page 1 of 1

Difficulty compiling, possibly related to homebrew gcc?

Posted: Mon Jun 10, 2019 9:46 am
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?

Re: Difficulty compiling, possibly related to homebrew gcc?

Posted: Mon Jun 10, 2019 10:04 am
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

Re: Difficulty compiling, possibly related to homebrew gcc?

Posted: Mon Jun 10, 2019 10:12 am
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.

Re: Difficulty compiling, possibly related to homebrew gcc?

Posted: Mon Jun 10, 2019 5:33 pm
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.