MinGW GCC and G++ Errors in Eclipse - c++

I'm new to this community and this is my first question. I know many people had had this problem before, but, it seems as if people solved it their own ways and I tried all the solutions I could find in google (and here, respectively), but none of them seem to work for me like it was supposed to. And just to make it clear, I use 32-bit Windows XP. Some versions that may work in 64-bit or newer operating systems may not work on mine.
So I'm very new to C and C++, I started by installing the Eclipse CDT, the moment I found out it did not have a compiler was when I installed MinGW which was bundled with a C compiler, a C++ compiler, and the MinGW Developer's Toolkit (which included MinSys). So after that, I started by creating a new empty C++ project called 'HyScript'. And did these:
I set the environment variables as:
C:\Program Files\Java\jre7\bin;E:\Mark\MinGW\msys\1.0\bin;E:\Mark\MinGW\bin
Then, I restarted eclipse, deleted the old projects, and created a new one with the same name (deleted the old folders) and chose the toolchair, "Cross GCC".
Now I haven't even started writing code, but there are already 4 errors:
Here's the link to the dropbox file
The last thing I did was open up the CMD before going here, and this happened: Here's another link to the dropbox file
I don't understand anymore... What did I do wrong? I set the environment variables right, I supposed. And, after doing some research, I still can't find a proper solution for me. It's been two days now, and this error still hasn't gone away.

You chose wrong toolchair "Cross GCC". Please select "MinGW"
The latest version of G++ can be found here. Please do NOT install it in the default directory but use this:
C:\MinGW
If you still have problems, uninstall everything you did, and watch these video instructions.

Related

OpenCV in Code::Blocks: The application was unable to start correctly (0xc00000be)

I set up OpenCV with Code::Blocks as per this tutorial: http://kevinhughes.ca/tutorials/opencv-install-on-windows-with-codeblocks-and-mingw/.
I've got as far as building the test program at the end successfully, but when I try to run it I get the following error: "The application was unable to start correctly (0xc00000be). Click OK to close the application."
The one thing that is certainly different from the tutorial for me is that I'm working with OpenCV 3.0.0, Code::Blocks 13.12 and the latest version of mingw (number not obvious from their website or the installer).
I found that other people had had this problem in the past, e.g. The application was unable to start correctly (0xc00000be)
However, it has been a long time since that thread was active, I'm working with newer versions of the software and, most importantly, the answer given there didn't help (I compiled openCV with the same mingw that I'm using with Code::Blocks), so I thought this question would be worth asking (sorry if it's not, I'm rather new to this).
Could anybody suggest a fix that might get rid of this error?
A few other things to note:
I didn't download the Code::Blocks that came with mingw as I was advised against it, I got them separately as per the tutorial
I have installed OpenCV and Code::Blocks on my E: drive, though mingw is still on my C:.
I have added both mingw and OpenCV to my PATH variable, and mingw to my Path variable
I have linked the libraries in both the main compiler settings for Code::Blocks and the Build Options of my project.
I'm working from a 64-bit Windows 7 Laptop, but I have done everything 32-bit style as advised in the tutorial.
Thanks in advance!
So, one solution I've found to this problem is to copy all the .dll files from "...\opencv\build\x86\mingw\bin" to the project file (build directory).
Having done that, the project will run fine. This still doesn't (directly) explain why it wont run without those files (at least, several sources including the tutorial imply it should), and so isn't really optimal. I will continue to look for a solution for this so I don't have to clutter every opencv project I make with the .dlls.
However, for anyone simply wanting to get stuck into coding who is having this problem, I recommend that solution.

How To Add zlib1.dll to MinGW

I am brand new to C++, although I know java pretty well, and I trying to set up compiler. I managed to download MinGW and modify my Path environmental variable. I am not at the point where when I go into the command prompt and type:
g++ --version
I get what Sam-s Teach Yourself C++ in 24 Hours says I should. But when I type:
g++ Hello.cpp -o Hello.exe
I get an error message that says "The program can't start because zlib1.dll is missing from your computer. Try reinstalling the program to fix this problem". I tried reinstalling multiple times, but nothing changed. Looking on Stack Overflow, I found that this is apparently a fairly common problem, and you have to add it to the file yourself.
I downloaded the file, but I can find/figure out where I am suppose to put it. The folder I downloaded is called zlib128-dll and it contains (among other things) the file zlib1.dll, which I think is what I want. What do I do with what to make the error message go away?
Other information:
-Using Windows 8.1
-I think I got the newest version of MinGW, since I just got it about 2 hours ago
It will work if you put zlib1.dll in any folder listed in path variable (or in the same folder with MinGW executable). I think, best way is to put it right into MinGW\bin.

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.

Program can't start because *.dll is missing - MinGW, Eclipse, Windows 7

I am well aware of the fact that a multitude of similar problems already appeared on this board, however none of the solutions helped me.
I am trying to get Eclipse CDT running with MinGW toolchain on Windows 7 Service Pack 1. I already did that on Windows XP and thought that the same procedure will make it run smoothly on Windows 7, but it seems I was mistaken ;)
After installing MinGW from the automatic installer (just in case I installed a few things more than what I needed) and adding the C:/MinGW/bin to my PATH environment variable, I tried to compile a simple Hello, World! program. Eclipse did not give me any errors, but it didn't want to give any output in the Console window. Alarmed, I tried to run the executable file outside of Eclipse and got the error that
"Program can't start because libstdc++-6.dll is missing".
Strangely enough, this dll is in the C:/minGW/bin directory, so the PATH variable should 'find' it - but it does not. Copying the dll to the directory with the executable file helped, but it is obviously a short-term solution and I would prefer to have a more "normal" one.
The thing that makes my problem different, I think, from the others I've noticed on this board is the fact that, for one, Eclipse does not find any errors with my PATH variable (which it usually does, if the MinGW was not included in the Path variable or something), and besides the required dlls are where they should be, but it seems my Windows can't find them.
The "real" solution is indeed to copy the DLL locally. You have to ship that dll when shipping your EXE.

Problem starting old programs created in VS6

I have some old programs that I created 7-8 years ago in C++ in Visual Studio 6.0.
I tried to start them today, but I had no luck. When starting up the program (or any other program I created at the time), I get the following error message:
I can see at least that MFC42D.DLL and MSVCP60D.DLL is present in the program folder, but honestly I do not remember what is required to start these programs any more, and I obviously do not have VS6 installed on my current machine.
Do anyone know what this error message mean, and what I can do to resolve it? I would love to start up these old programs again to see what they look like :)
EDIT
I got a step further now, after I put a new DLL, but now the problem is that Direct X 8 is not getting set up properly. I thought DirectX was backwards compatible, but do I have to install DX8 as well? Will it work having two DirectX versions installed at the same time?
You need a program like dependencywalker, that would show you all the DLLs that your programs need. Then you would have to find all those DLLs.
Another option is to find a copy of VisualStudio 6 and install in on your machine.
A third option is to get a more recent version of Visual Studio, and to try to recompile your code.