1 year ago

#387513

test-img

prashant

Error while compiling c++ code in gcc compiler in macOS

I have been trying to setup a c++ code execution environment in my macOS. I am using sublime text editor. I have installed gcc compiler(v11) and then i have created a link to g++ that points to g++-11 using command cd /usr/local/bin/ and then linking it using ln -s g++-11 g++ and i have added a new build system for c++ execution. The build file is

{
"cmd": ["g++.exe","-std=c++17", "${file}", "-o", "${file_base_name}.exe", "&&" , "${file_base_name}.exe<inputf.in>outputf.in"],
"shell":true,
"working_dir":"$file_path",
"selector":"source.cpp",
 // "keys": ["ctrl+q"], 
    // "command": "cancel_build" 
}

and saved it to default user. Now when I am trying to run the build it is giving an error ld: warning: dylib (/usr/local/Cellar/gcc/11.2.0_3/lib/gcc/11/libstdc++.dylib) was built for newer macOS version (11.5) than being linked (11.3) . I have tried to look around this but haven't found solution to it . Any help would be appreciated

c++

macos

gcc

sublimetext3

0 Answers

Your Answer

Accepted video resources