I'm trying to change my Clion(ver 2020.3) complier from the default clang to g++. I have already installed g++9 with homebrew but I'm having trouble to change it in Clion. Most of the respond I found is for windows not Mac. So can anyone teach me how to do it? Thanks in advance.
I found out that I accidentally set the directory to gcc instead of g++, because after I corrected it, the compiler works.
Related
dylib (/opt/homebrew/Cellar/gcc/11.2.0/lib/gcc/11/libstdc++.dylib) was built for newer macOS version (11.4) than being linked (11.0) whenever I compile any c++ or c code I get this warning my gcc installed version is g++-11 can anyone tell me how to fix this warning?
To fix this problem you need to update gcc.
If you have homebrew installed then just run brew upgrade gcc on you favourite terminal. It worked for me!
So I just recently downloaded a C++ IDE called Code::Blocks and made a new project. But when I tried to Build and Run it, the code gave some errors. I know that it isn't a problem with syntax or anything like that because I ran the default code that Code::Blocks provided. The error is the following:
Project/Target: "firstcpp - Debug":
The compiler's setup (GNU GCC Compiler) is invalid, so Code::Blocks cannot find/run the compiler.
Probably the toolchain path within the compiler options is not setup correctly?!
Do you have a compiler installed?
Goto "Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup.
Tried to run compiler executable 'C:\MinGW/bin/gcc.exe', but failed!
Skipping...
Nothing to be done (all items are up-to-date).
It seems to me like there is some kind of issue with the C++ compiler, but I thought Code::Blocks already came with a C++ compiler, so I'm not too sure what the issue here. I also followed their instructions to go to Settings->Compiler...->Global compiler settings->GNU GCC Compiler->Toolchain executables, but I'm not too sure what they mean by fix the compiler. Here is a screenshot of what I'm seeing:
Also here's info on my PC if you need it:
At this point I'm not too sure what to do to fix this problem. I have asked my friends about this problem(they have already successfully downloaded and used Code::Blocks), and they said that they never encountered this problem while they were installing it.
You need to ensure that you have a working installation of the GNU Compiler Collection, and that the paths you select for your toolchain exist.
If you don't already have GCC Installed, the easiest way would be to download a Code::Blocks distribution that comes pre-bundled with MinGW from the download site. However, it's also possible for you to install GCC through other means, such as:
Installing GCC with MinGW through msys2, or
Installing GCC with scoop install gcc on Windows
In either case, you need to select the installation path that contains the bin directory when setting up the toolchain in Code::Blocks.
In case you didn't notice, C::B formed the path to compiler with both "\" back slashes and "/" slashes, which simply isn't a valid Windows path !!
Slashes are used in Linux not Windows! But for some reason C::B is not getting this. And probably your Mingw is well set !!
C:\MinGW/bin/gcc.exe should be C:\MinGW\bin\gcc.exe
I had pretty hard time trying to fix this in win 7 32 bit/C::B version 20.03 but with no success, i checked all available options and settings, and actually i started to think that it's a bug.
When i trying to install wxwidgets i getting this error message:
What should I do?
You have some other gcc in your path, the normal one definitely understands all of these options and, contrary to a comment above, no space is needed after -MT. Try running where gcc to find out where is it coming from and set up your PATH to exclude it.
FWIW I've just tried building wxWidgets with TDM 5.1.0 and it worked without any problems.
The Problem is that some files from your compiler are missing
Solution:
Try reinstalling you Compiler. If you are using CodeBlocks, reinstall it because it contains compiler with its installer.
I have a project that uses cmake that I'm trying to compile (MapCrafter). I've already done cmake . to make the makefile. I've run brew install gcc47 to get GCC 4.7. It put it in /usr/local/Cellar/gcc47 for some reason.
Whenever I run make, it still uses GCC 4.2.1 at /usr/include/c++/4.2.1/ that cannot compile this code. I can't find any option for switching the compiler that works. make CC=/usr/local/Cellar/gcc47/4.7.3/bin/gcc-4.7 CXX=/usr/local/Cellar/gcc47/4.7.3/bin/c++-4.7 still uses 4.2.1. I almost never compile anything outside of Xcode or apt-get, so I'm really ignorant in this area. What step am I missing?
I do not know why this worked this time and not before, but I used cmake-gui and hit configure. Then I set my C compiler to /usr/local/Cellar/gcc47/4.7.3/bin/gcc-4.7 and my C++ compiler to /usr/local/Cellar/gcc47/4.7.3/bin/c++-4.7 and made the makefile. I've already tried this and don't remember changing anything… Now, make is using the correct GCC.
Someone might have a better answer than this, so I'm not going to mark my own answer as correct at all.
I used to have an older version of MinGW installed on my windows machine.
When I compiled my program under "Release" mode using the MinGW tool collection for build in NetBeans IDE, my executable was roughly 700KB.
Then, I recently installed the latest MinGW (mingw-get-inst-20120426.exe).
After the installation, I re-built my program and the executable is now 275KB and it doesn't seem to be reading the passed-in arguments correctly. The build is "BUILD SUCCESSFUL". It does have warnings for deprecation-related issues, but this existed before the new install.
I am really confused. Do you know what the problem is?
Thank you
Neo
WOW. It works now. I think removing C:\cygwin\bin from the PATH fixed the problem. Ahhh. Is that right? That's strange though because I specifically told NetBeans to use the MinGW toolset. Thanks for your help everyone.
in this case you did mix compilers. paths matter mate.