I just downloaded the latest version of Dev-C++, and having never used it before, had know idea what to do to get a program to compile. I finally got a simple program to compile, and the only include file i want to use, iostream.h, is not working. It gives me a million errors, and all the program does is outputs "Hello". Any advice?
dave
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please search the forum before just coming in and blurting out a question. There is a convenient little box labeled search. You would have found some useful information from lately just by searching on iostream.h. Also:
(1) You did not say what version you are using. "Latest" is meaningless. Version number and which version of gcc you are using is neccessary.
(2) Saying you get "errors" is also meaningless. WHAT errors? Post them. Post the code.
(3) iostream.h is depricated, has been for years. Check this link out: http://www.cplusplus.com/doc/ansi/hfiles.html
Now, I will take a wild shot here and guess you are using the gcc-3.2 version of 4.9.7.0 (this is the sort of information you should give, not "Latest", there is more than one latest. If so, here is some text I wrote that may be helpful:
For some issues that have arisen with the 4.9.7.0 /gcc-3.2 release of
Dev, involving contents of some directories named bits, which
leads to a lot of errors, there are two fixes that have been
shown to work. Because it is minimally invasive, you might wish
to try number 2 before number 1.
Both BlakJak and Derek have worked hard to develop these
work-arounds, while the installation program get fixed up. This
version of Dev is the first to attempt to allow the user the
flexibility to use either gcc-2.95 of gcc-3.2 as the compiler,
with the same IDE. This is non-trivial and may take a a bit to
get things exactly right.
Solution Number 1:
Copy the files of C:\Dev-Cpp\include\c++\mingw32\bits
to C:\Dev-Cpp\include\c++\bits
Solution Number 2:
Add C:\Dev-Cpp\include\c++\mingw32 to your compiler:directories:C++ includes
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I sincerely apologize for that. I'm new to this stuff, and I just wanted to try it out for kicks. Apparently, solution number two worked perfectly. I really appreciate your help, and I won't post stupid questions anymore. I do have one more question that I hope is not a stupid one. Does the program not allow you to have spaces in directory names, i.e., the c++ include directories
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Your question was far from stupid, just consider doing stuff like searching the forum something you do before you ask. And when you ask, try to think like you will have to answer the question yourself. What will you need? To know exactly what software provokes an error, what error you got, and what compiler you are using.
Now, I will give you a guiding thought on directories with spaces in them. The compiler you are using, gcc, has its background planted firmly in the UNIX world. That is the reason you have this beast hanging around called MingW. It is an environment that lets what is essentailly a UNIX tool run on your PC.
Now, spaces in filenames are an issue in the UNIX world. You can get around that issue, but it takes some doing. So, I *try* to be careful and avoid putting stuff in directories with spaces in their name. It will work some of the time, but also screw you up some of the time.
Now, I am VERY glad solution 2 worked for you, because it is less invasive in terms of changing details of your setup.
Note that since it looks like you are using the gcc-3.2 version, there may be some Dev-packages which do not work quite right, there will be some trial and error involved there.
I (personally) like gcc-3.2, while it is slower compiling, and can make bigger executables (you can help that by including -s in your compile options), if you set your compile flags right, it can generate code that is faster running. It is also more standards compliant, so it will give you warnings about doing stuff like iostream.h rather than iostream.
Now, it is your duty to go forth, have fun, and pass your knowlege along.
Wayne
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I just downloaded the latest version of Dev-C++, and having never used it before, had know idea what to do to get a program to compile. I finally got a simple program to compile, and the only include file i want to use, iostream.h, is not working. It gives me a million errors, and all the program does is outputs "Hello". Any advice?
dave
Please search the forum before just coming in and blurting out a question. There is a convenient little box labeled search. You would have found some useful information from lately just by searching on iostream.h. Also:
(1) You did not say what version you are using. "Latest" is meaningless. Version number and which version of gcc you are using is neccessary.
(2) Saying you get "errors" is also meaningless. WHAT errors? Post them. Post the code.
(3) iostream.h is depricated, has been for years. Check this link out:
http://www.cplusplus.com/doc/ansi/hfiles.html
Now, I will take a wild shot here and guess you are using the gcc-3.2 version of 4.9.7.0 (this is the sort of information you should give, not "Latest", there is more than one latest. If so, here is some text I wrote that may be helpful:
For some issues that have arisen with the 4.9.7.0 /gcc-3.2 release of
Dev, involving contents of some directories named bits, which
leads to a lot of errors, there are two fixes that have been
shown to work. Because it is minimally invasive, you might wish
to try number 2 before number 1.
Both BlakJak and Derek have worked hard to develop these
work-arounds, while the installation program get fixed up. This
version of Dev is the first to attempt to allow the user the
flexibility to use either gcc-2.95 of gcc-3.2 as the compiler,
with the same IDE. This is non-trivial and may take a a bit to
get things exactly right.
Solution Number 1:
Copy the files of C:\Dev-Cpp\include\c++\mingw32\bits
to C:\Dev-Cpp\include\c++\bits
Solution Number 2:
Add C:\Dev-Cpp\include\c++\mingw32 to your compiler:directories:C++ includes
Wayne
I sincerely apologize for that. I'm new to this stuff, and I just wanted to try it out for kicks. Apparently, solution number two worked perfectly. I really appreciate your help, and I won't post stupid questions anymore. I do have one more question that I hope is not a stupid one. Does the program not allow you to have spaces in directory names, i.e., the c++ include directories
Your question was far from stupid, just consider doing stuff like searching the forum something you do before you ask. And when you ask, try to think like you will have to answer the question yourself. What will you need? To know exactly what software provokes an error, what error you got, and what compiler you are using.
Now, I will give you a guiding thought on directories with spaces in them. The compiler you are using, gcc, has its background planted firmly in the UNIX world. That is the reason you have this beast hanging around called MingW. It is an environment that lets what is essentailly a UNIX tool run on your PC.
Now, spaces in filenames are an issue in the UNIX world. You can get around that issue, but it takes some doing. So, I *try* to be careful and avoid putting stuff in directories with spaces in their name. It will work some of the time, but also screw you up some of the time.
Now, I am VERY glad solution 2 worked for you, because it is less invasive in terms of changing details of your setup.
Note that since it looks like you are using the gcc-3.2 version, there may be some Dev-packages which do not work quite right, there will be some trial and error involved there.
I (personally) like gcc-3.2, while it is slower compiling, and can make bigger executables (you can help that by including -s in your compile options), if you set your compile flags right, it can generate code that is faster running. It is also more standards compliant, so it will give you warnings about doing stuff like iostream.h rather than iostream.
Now, it is your duty to go forth, have fun, and pass your knowlege along.
Wayne