Use of terminal and compiler in geany for windows7 - c++

How can we integrate a terminal and compiler to geany message window in windows7 so that i can excute the c++ program ?

I'll be very quick on this one because that's a question that gets asked a lot here.
First, you need to install the compiler (gcc and g++), then, you need to edit the %PATH% environment variable of Windows 7. Just add the directory where the gcc.exe and g++.exe are located. And, voilĂ .
Here's yet another related question: Geany compiling
For your terminal question, I don't know if the VTE plugin is available for windows. You should definitely use that instead of the windows cmd...
Usually, executing a program is done by pressing F5.

Related

Qt command error when nmake the odbc files

I'm new for C++ and Qt.
Recently, I was learning Qt with MS SQl, but I met a problem when compiling the odbc files.
Firstly I run qmake and it goes well. But when I use nmake, the following errors happened:
module machine type 'x64' conflicts with target machine type 'x86'
I encountered similar problem just today.
Same as you,
I tried almost all comand tools include the one in qt, vs2015 x86,x64
command prompt, and cross tools as well. But none of them works.
I solved the problem by the following:
Deleted the whole project and its folder completely.
Created the project anew.
Made sure %PATH% variable, aside from irrelevant paths, contained only path to proper Qt build. In my case %PATH% contained 'C:\Qt\5.5\msvc2013_64\bin'. By proper i mean, of course, a Qt build that was built using the same compiler I was trying to compile with.
Then I ran VS2013 x64 Native Tools Command Prompt.
Switched to the project folder.
Then i did qmake and then nmake and it was all OK.
I think the problem was that, as drescherjm suggested,
If you tried one time with the wrong command prompt then tried again on the same build folder you build folder would have been broken by the bad try.
and therefore,
You will have to clean build between tries.
Thanks to drescherjm and Herman Nurlygayanov, the problem is finally solved.
Here is some experience I get from this problem:
The version of Qt creator whether 32-bit or 64-bit should be made sure before all these stuff by checking the About Qt creator. It is important to choose the right version of command prompt before compiling.
Besides, If a 32-bit command prompt is used, then vcvars32.bat should be executed. As for 64-bit version, vcvarsall.bat should be executed. They are located in %dir of you vs%/vc and %dir of you vs/vc/bin respectively.
If any error happened during one compiling, another qmake must be executed in next attemption.

NetBeans Run in external terminal

I recently installed Arch Linux with XFCE4 desktop environment. I use NetBeans as my IDE. I want to debug a program through NetBeans in an external terminal, but it won't do that. It does not recognize XFCE4 Terminal, and will not run gdb within it.
Is there a way that I can permanently set NetBeans to debug/run my programs in XFCE4 Terminal (aka, add it to "run in external terminal")?
Also, I'm using NetBeans 8.0-1, and gcc 4.9 (all the latest and greatest with Arch! :), if that helps at all.
If you need any more details, please ask.
After installing Konsole (a KDE terminal), I was able to make it work! Using XFCE as my default still, though, since it's a really nice terminal.
Gnome terminal did not work. When I opened it, it did not show any text, and I couldn't verify input or output as a result.

Can't run C++ in NetBeans: "No Shell Found" error

I'm trying to learn C++ using NetBeans but even though I have CYGWIN and everything set up in my PATH, I keep getting an error that says: "No shell found. Cannot proceed. Please install either CYGWIN or Msys."
I don't know what Msys is but since the error says "or" I assume that if I have CYGWIN that I don't need to have Msys.
I'm trying to run the basic "Hello World!" tutorial but this error from what I've seen isn't covered. I'm getting aggravated because I have a project I need to have done in a few weeks.
If anyone has any answers for me, that would be great. I can supply screenshots if you need them.
Cygwin alone is not enough, first of all you have to check if you installed C++/gcc/gdb packages in your Cygwin.
From Cygwin/Net beans docs:
Open the Control Panel (Start > Settings > Control Panel) and double-click the System program.
Select the Advanced tab and click Environment Variables.
In the System Variables panel of the Environment Variables dialog, select the Path variable and click Edit.
Add the path to the cygwin-directory\bin directory to the Path variable, and click OK. By default, cygwin-directory is C:\cygwin. Directory names must be separated with a semicolon.
Click OK in the Environment Variables dialog and the System Properties dialog.
If it fails you could try to Re-Install Netbeans from/within an cygwin/bash instance start the netbeans from a cygwin/bash instance.
Netbeans should automatically detect gdb/g++
PS: I'd prefer to use a good Gnu/Linux distro
I had the same problem with 8.1.
Adjusting the %PATH%-variable - in my case adding C:\msys64\usr\bin - solved it (as wdavilaneto's slightly verbose answer suggested).
This is not an answer but it adds to this question, I know that isn't very objective but in this case there may be a problem with Netbeans. I have 7.3 so this could be the reason. I am getting the same error but it used to work just fine, then one day it just stopped working and couldn't find the Shell. I have everything you need to make C/C++ work for Netbeans and it was working, for a while too!
It is rather old, but I've had the same issue a moment ago. It "Solved itself" by Creating a new "welcome sample" project and then made it run, then went back to my original project and made it run again. For me, it solved the problem. Probably it is related to an issue with Netbeans as Cian said.
Btw, I'm with Netbeans 8.1.
Make sure the shell is in your path! Depending whether you have Cygwin, Mingw32, Mingw32, TDM Mingw... it will be somewhere here:
c:\<installation path>\usr/bin
Hmh, I have 2 C compilers one for 64bit and one for 32bit set in NetBeans. When I had 32bit compiler without 64bit one then compiling went fine but when I have installed 64bit then NetBeans has started to do some problems, firstly everything went fine but then I started to get this problem to. For me fix is to switch from 64bit compiler back to 32bit compiler, then compile my program and then go back to 64bit compiler and now I can compile it with 64bit compile... Not sure why is this fixing it.
I have this problem with Netbeans 10.
Computer is Windows 10 x64.
Resolved by following the answer given by TNT.
Problem was when start building my project the said "no shell" (the topic of this posting) dialog box popped up. Since there was no command prompt, the build tools cannot run - process cannot spawn.
Solution was to give the correct path (environment variable). Since I am using MSYS, Since I am using MSYS, adding
F:\msys64\usr\bin
to my PATH made it work.

Dev C in Windows 8: gcc Internal Error

I am a teacher's assistant for a C programming class, and the instructor uses Dev C++ as the compiler for the class. Personally I would use a different one, but the choice is not mine here. Recently I installed the Windows 8 Professional 64 bit that is available on Dreamspark though my university, so I can start with some metro app development for some contests. Unfortunately, Dev C++ has stopped compiling. It previously worked fine with Windows 7 64 bit.
I get an error when compiling that reports back:
Compiler: Default compiler
Executing gcc.exe...
gcc.exe "C:\Users\James\Documents\Homework\TA_CPRE_185\counter.c" -o "C:\Users\James\Documents\Homework\TA_CPRE_185\counter.exe" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
gcc.exe: Internal error: Aborted (program collect2)
Please submit a full bug report.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.
Execution terminated
Compilation successful
It says the compilation is successful but it is not, so no executable is made. I want to know if anyone has any ideas of what might get Dev C++ to work on this version of Windows, so I don't have to run Dev C++ in a virtual machine? I need it working, so I can do class demonstrations.
Please tell your teacher to update Dev-C++ instead:
http://sourceforge.net/projects/orwelldevcpp/?source=directory
This one ships with a working MinGW 4.7 or a TDM-GCC 4.6.1 (x64) compiler, fixes endless amounts of bugs, and is also portable.
I believe that Dev-C++ comes with a very old version of MinGW (3.4.x if I'm not mistaken). MinGW versions before 4.2.2 will have problems compiling programs on Windows Vista and later unless they are on the PATH.
So you can either update your version of MinGW (as you mentioned in a comment that you have already done), or you can add the MinGW\bin directory to the system path.
If you cannot change your MINGW version, you can try to rename the following file :
MinGW\libexec\gcc\mingw32\3.4.2\collect2.exe to collect2.exe.old
(this solution worked after a migration from W7 to W10).
I received the same error, but was able to get around it by doing the following.
Remove application using add/remove programs
Disable user access controls
Reboot
Download Dev-Cpp 5.4.0 TDM-GCC x64 4.7.1 Setup.exe
Right-click on downloaded file and change to "win7 compatability mode" for all users and select "run as administrator" and click "OK".
Right-click downloaded file and choose "run as an administrator" (note: this shouldn't be necessary, but it's windows so cover your bases)
Choose all the defaults, but on the last screen, deselect "run Dev C++ now" and then select "finish"
Open windows explorer and browse to the install directory C:\Program Files (x86)\Dev-Cpp and locate "devcpp.exe"; right click and choose "win7 compatability mode" for all users and select "run as administrator" and click "OK" (again, this is probably not necessary, but it doesn't hurt anything either).
Double-click the application and pin to your taskbar for ease of use.
Open a new project and test it out, it should work w/o issue.
I used MinGW Installation Manager to download the last version of C Compiler (5.3.0-3 at this moment) and I repliced the files in the folder of Dev-Cpp. Now, its working perfectly in my Windows 10.

Configuring Eclipse for MinGW

I am using Eclipse Juno with MinGW (latest version) on my Win7-Laptop.
My example code is successfully built within the IDE, but I can neither run nor debug it!
When I choose Run as=>Local C/C++-Application, I get
Launch failed. Binary not found.
However, there IS an exe-file as a result of the build process!
When I call cmd.exe, navigate to the source directory and call this built exe (a.out.exe), it works without problems!
I guess this is due to wrong/missing configuration of eclipse, but I couldn't find useful info on that so far.
This thread mentions environment variables. I added MinGW and Msys to my PATH variable (that's why I can compile) but I can't run my software in eclipse!
So, what can be done to enable debugging?
I have made a little tutorial.
how to set all for Eclipse have a look it's here https://stackoverflow.com/a/12169583/1322642
Hope it can help you a little bit.