agrawal-d/cph

Some issues about compiling in Macos

FanxwGit opened this issue · 5 comments

I want to use the GNU g++ in MacOs
set the path and alias in the ~/.bash_profile and ~/.zshrc
like this

~/.bash_profile

export PAHT=/opt/homebrew/bin/gcc-13:$PATH
alias gcc=gcc-13
alias g++=g++-13

~/.zshrc

alias gcc=gcc-13
alias g++=g++-13
export PAHT=/opt/homebrew/bin/gcc-13:$PATH
source ~/.bash_profile

and it really works in both my terminal and vscode terminal (zsh and bash)

~ % g++ --version
g++-13 (Homebrew GCC 13.2.0) 13.2.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

but it doesn't work actually in the CPH, i use the flowing code to test the defualt compiler.

#include <iostream>

int main()
{
#if defined(__GNUC__) && defined(__clang__)
    std::cout << "This is Clang's g++" << std::endl;
#elif defined(__GNUC__)
    std::cout << "This is GNU's g++" << std::endl;
#else
    std::cout << "This is some other g++" << std::endl;
#endif

    return 0;
}

As shown in the figure below, cph use the clang g++ compiler inteated of gun g++.

image

So, If i want to use the gun g++, how to do that?

CPH is a very good extension, i would be appreciated if you help me solve this problem, thanks.

i havd solved it , just config gcc-(your gnu version) is ok.
image

Hey!
I am encountering a very similar issue.

My code isn't running using the cph extension. It always shows "SIGKILL" as the output.
However, the code runs fine in the terminal

Screenshot 2024-02-15 at 9 24 55 pm

I have also just switched from clang to GCC on my mac

Do you know of any way to resolve this?

Hey! I am encountering a very similar issue.

My code isn't running using the cph extension. It always shows "SIGKILL" as the output. However, the code runs fine in the terminal

Screenshot 2024-02-15 at 9 24 55 pm I have also just switched from clang to GCC on my mac

Do you know of any way to resolve this?

I haven't encountered this problem yet. Have you correctly configured g++ (your version) in the settings, just like I did?

Hey! I am encountering a very similar issue.
My code isn't running using the cph extension. It always shows "SIGKILL" as the output. However, the code runs fine in the terminal
Screenshot 2024-02-15 at 9 24 55 pm
I have also just switched from clang to GCC on my mac
Do you know of any way to resolve this?

I haven't encountered this problem yet. Have you correctly configured g++ (your version) in the settings, just like I did?

Yep

Resolved my issue.

I have given the reason in #413

You can close this now @FanxwGit