How to configure terminal for all projects - webstorm

When I'm setting a terminal settings it's marked as a settings for a current project:
Is there any way to set this setting for all projects from settings dialog?

Upgrade your IDE.
Latest 2016.3.2 (must be build 163.9251 or newer) has only "Start directory" as project settings -- all other are IDE-wide.
https://youtrack.jetbrains.com/issue/IDEA-164206#comment=27-1749073
(screenshot is from PhpStorm 2016.3.2 EAP build)
As for older IDE versions -- try settings it up at File | Default Settings... .. but it will affect only future new projects and not current ones.

Related

Eclipse Console says cannot run cmake

I could not find the answer to my problem in the other similar questions.
After installing Eclipse IDE for C/C++ Developers on my mac, when I want to run a simple Hello program in C++, I get the following error in the console:
Error: build command 'cmake' not foundFailure running cmake:
Any ideas will be appreciated.
That answer does the job perfectly:
Under Eclipse Preferences -> C/C++ -> Build -> Environment click the select button then check the PATH row and click ok.
Double-click on the PATH row and modify the value by adding a :then the location of your make executable (for me /Applications/CMake.app/Contents/bin/cmake so I added /Applications/CMake.app/Contents/bin)
Tested on macOS Monterey 12.6 and Eclipse IDE for C/C++ Developers 2022-09 (4.25.0)
I followed the answer provided here and it worked.
Make sure to replace the PATH string by your echo $PATH output in the Info.plist, as mentioned here. Also, execute the command suggested here.
I am on macOS Catalina 10.15 and Eclipse IDE for C/C++ Developers Version: 2019-09 R (4.13.0).
Ps: I also tried to set the environment variables on Eclipse, as suggested here, but it did not work.

How can I compile Assimp with Netbeans in debug mode?

I am not a C/C++ developer, I tried to google but I couldn't find anything about.
Trying to write a simple java port of Assimp, I modified the Main.cpp code runs fine but it doesn't stop at the breakpoint, I guess because I am not compiling in debug mode.
My steps:
cloned assimp
from terminal in the directory cmake -G "Unix Makefiles"
opened the project in Netbeans from "existing sources"
compiled
This is my project Debug Property:
I don't have any other configuration other than the "Default" one.
How can I solve?
Cmake based projects are configured using the cmake configuration. Instead of switching to debug / release configuration within netbeans - as usual for "default" C/C++ Projects - you have to set CMAKE_BUILD_TYPE variable accordingly.
Using command line:
Debug: cmake -DCMAKE_BUILD_TYPE=Debug
Release: cmake -DCMAKE_BUILD_TYPE=Release
You do not need to repeat the other flags like, -G ….
Alternatively use the CMake GUI.
To get the selectable build configurations you can create them your own (go to Build -> Pre-Build and add calls as above).
TIP
It's recommended to do an out-of-source build.

Why are the C++ perspective and new project options not available in Eclipse?

I installed the "Eclipse IDE for Java Developers" package from the Eclipse website. I work with C++ projects as well, so I used the "Install New Software..." menu option to install the "C/C++ Development Tools" package. After doing so and restarting Eclipse, the C++ perspective did not appear; clicking on the "Open Perspective" button did not show the "C/C++" option. I also found that I was unable to create a C++ project; the "C/C++" tree node did not appear in the New Project wizard. The Java perspective and new project options were available.
I verified that CDT was installed by going to the "Installed Installation Details" dialog - "C/C++ Development Tools" appeared in the "Installed Software" list. I tried uninstalling this package and reinstalled it again without success. I tried removing the Eclipse installation altogether and installing the "Eclipse IDE for C/C++ Developers". There were no C/C++ options in this installation either. I checked the .log file in the workspace directory and found nothing unusual.
Why are the C/C++ features not available after installing the CDT feature in Eclipse?
The path for this system Eclipse was installed on included a 1.3.1 version of the Java runtime environment and the Eclipse executable was using this version to run Eclipse. Unfortunately, there doesn't appear to be any indication of this in Eclipse, nor any indication that anything failed.
Using the instructions here, I changed the JVM to javaw.exe in a Java 7 installation. After doing so, the C/C++ perspective and new project options appeared in Eclipse.
I ran into the similar problem with Eclipse-Luna(4.4) on Yosemite(10.10).
- NOT able to get the C/C++ perspective with JRE (8u25) or java 1.6 on Yosemite.
But I manage to get C/C++ perspective with the installation of JDK(8u25).
I also had the same issue.
I just installed java7 and restarted eclipse:
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
I had this same problem on Linux (CentOS 6.5 32-bit) with Eclipse Luna:
I installed standard Eclipse (eclipse-java-luna-SR1-linux-gtk.tar.gz)
In eclipse, under Help->Install New Software I added the p2 software repository to the list of sites: http://download.eclipse.org/tools/cdt/releases/8.5
I installed C/C++ Development Tools and C/C++ Development Tools SDK
In CentOS, I also installed OpenJDK Development Environment java-1.7.0-devel-1:1.7.0.65-2.5.1.2.el6_5 (i686).
I edited eclipse.ini to increase the Xmx setting to 1024m from 256m, but I did not add a -vm property. In the Eclipse preferences after restarting, I verified it was using JDK 1.7.
The C++ perspective was not contained in the list of available perspectives.
But C++ Project was an option in the File->New menu, and when I chose it, Eclipse asked me if I wanted to use the C++ perspective. I said yes, and it appeared, and is now available in the perspectives list as well.
The fix for me was to install the latest JDK from Oracle. I had a fresh install of Yosemite and the Eclipse for Java developers. The C/C++ option showed up after the install and restart of Eclipse. Hope it helps!

How to install C++ plugin to Eclipse?

I have Eclipse Helios and wanted to code C++ using it, but I keep running into the "Launch failed. Binary Not found" error.
I installed the MingW C++ compiler using the "mingw-get-inst-20120426" file and selected the "C compiler, C++ compiler, MSYS Basic System, and MingW Developer Toolkit".
Then I went to Eclipse > project > properties > C/C++ General > Paths and Symbols, then selected the GNU C++ in the Includes tab and added the "C:\MinGW\lib\gcc\mingw32\4.6.2\include\c++" path.
I also went to C/C++ build > Environment and appended the "C:\MinGW\bin;C:\MinGW\msys\1.0\bin" to the PATH.
Then I created a Hello World C++ project, selecting the MingW GCC under Toolchains, and then built the project using the "hammer" icon.
However, once I ran the HelloWorld program it gets the "Launch failed. Binary Not Found" error.
Here is another error:
g++ -IC:\MinGW\lib\gcc\mingw32\4.6.2\include\c++ -O0 -g3 -Wall -c -
fmessage-length=0 -osrc\HelloWorld.o ..\src\HelloWorld.cpp
Internal Builder: Cannot run program "g++": The system cannot find the
file specified.
I also downloaded the CDT (C/C++ Development Tooling) and transferred the "features" and "plugins" folder to the eclipse folder.
Can someone please give me step-by-step on how to resolve this?
Firstly, in the following examples all drive-letters should be replaced with the relevant ones on your system. Not all of these steps are really necessary, but it works (and the more the merrier).
We start with the slightly simpler release config - we want to make it compile.
Go to Project -- Properties
Look if the include directories are correct and in place.
Go to Project -- Properties -- Run/Debug Settings -- NEW -- Main Tab
Set to Release and Browse to the Release folder of the project. If the exe file is not set type in its name.
Switch to Common Tab. Check Allocate Console and Launch in Background. Don't Run yet.
Go to Project -- Properties -- C/C++ Build -- Discovery Options
Tools -- GCC C++ Compiler
"Browse" to the mingw bin folder and select the g++.exe or copy mingw32-g++.exe to g++.exe
Note: The image points to mingw32-g++.exe please use g++.exe
Right click on the project and look -- Build Configurations -- Set Active -- Release is checked.
Right click on the project -- Run As -- Run Configurations.
Under C/C++ Application select, the one which refers to the release version. Then click Run
If this works, I will show you how to set the Debug Properties. (more complicated)
Nowadays (Eclipse Juno and newer), it is much simpler. You just need to:
Install MinGW (and including C++ compiler)
Add the paths "C:\minGW\bin" and "C:\minGW\msys\1.0\bin" (or wherever you installed MinGW to) to your Windows "Path" variable
Install Eclipse. If Eclise already is installed, restart it. it will recognize that MinGW is now available.
Create a New project: "C++ Project"
For every Project type in the following dialog, you should now be able to select the "MinGW GCC" toolchain
Happy coding
See here: http://www.youtube.com/watch?v=QhvXCg2CY4Q
g++ is installed as part of MinGW. If you are getting an error in Eclipse that it cannot find g++ then your path is most likely incorrect. From a command prompt you should be able to run:
g++ --version
and it should display the version of g++ in the MinGW/bin directory.
Eclipse uses this path to locate the include files and the compiler. Once you get the path correct restart Eclipse and the problems listed in your question should be resolved.

How to compile and run C++ with MinGW using Eclipse and CDT?

I would like to do some C++ development on Windows using Eclipse and the CDT plugin. I use Eclipse Helios SR1 and have installed the CDT plugin. I have also installed MinGW and now I wrote a simple "Hello World" in Eclipse.
hello.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World" << endl;
return 0;
}
In Eclipse using the CDT plugin and the MinGW compiler. How can I compile my program? And how can I test run the program from within Eclipse?
Does Setting up Eclipse CDT on Windows, Linux/Unix, Mac OS X work for you?
After browsing many threads and articles I've found a solution.
Solution tested on Windows 10 x64 on Eclipse Neon.3 Release (4.6.3) with C/C++ Development Tools 9.2.1.201704050430 and MinGW
System configuration
Download MinGW. Any distro might work. I used the distro recommended on http://isocpp.org/
Extract archive into C:\MinGW (actually to C:\, because archive contains folder MinGW)
RMB on This PC -> Properties -> Additional system settings -> Tab Advanced-> Button Environment variables
On second table System variables click New. Name variable MINGW_HOME and set path to MinGW install folder C:\MinGW and then OK
Find variable Path in table and choose Edit
In new window click New and type %MINGW_HOME%\bin\
Confirm actions by clickig OK in opened windows
You can check availability of new tools by typing in command line g++ --version You should see something like
g++ (GCC) 6.3.0
Copyright (C) 2016 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.
Eclipse CDT configuration
Install Eclipse with CDT or just add CDT to existing Eclipse installation
Go to the folder with installed MinGW (C:\MinGW\bin\). Make a copy of file gcc.exe (DO NOT RENAME original file!)
Rename copied filed to mingw32-gcc.exe (You should have both files gcc.exe and mingw32-gcc.exe in \MinGW\bin\)
Open Eclipse and select C\C++ perspective
Go to Window -> Preferences -> C\C++ -> Build -> Environment
Click Add and type PATH as name and click on Variables and select Path. Confirm with Ok.
Select new variable PATH by clicking Select and then Ok.
Restart Eclipse
Now you should be able to compile Hello World program. Just select New -> C++ Project. Here you should see available MinGW as Toolchain
Just add MinGW to System Path(System configuration part in AndriiL's post) is enough. The variable named PATH with ${PATH} as value will be added automatically in Window -> Preferences -> C\C++ -> Build -> Environment and you can see MinGW GCC as a toolchain option in project wizard. If no PATH variable presented, Eclipse CDT may not load the recent System Path changes in the OS(Click Select... and choose Path variable, the value may not contain MinGW path), just Exit Eclipse and open it again.
Chocolatey is one package manager that allows mingw install with a single command using Windows Powershell.
choco install mingw --version=8.1.0
After the installation is done, add the below toolchain path to Eclipse->Window->Preferences-> Core Build ToolChains -> User Defined ToolChains.
C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin\gcc.exe
Restart eclipse.
The MinGW toolchain should be available for use now in Eclipse.