I'm using Dev-C++ version 4.9.9.2 on Windows 7 64 bit for an intro to C++
class. The "problem" is, I can write code in Dev that compiles and runs
perfectly, but doesn't compile in Microsoft Visual Studio or g++. For example,
I forgot the #include <string> in one homework problem and it compiled and ran
perfectly, but I got very little credit for it because it didn't work in
Visual Studio or g++. Dev also seems to be automatically setting variables
equal to zero, which visual studio doesn't like either.
I looked through the faq's and didn't see anything that answered my question.
Any help would be appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Dev-Cpp uses the mingw compiler which is causing the problem.
It is not unusual for a program to have errors when you change compilers. You
should compile it with the compiler your class uses to be sure it works. Mingw
will automatically include headers if it can determine they are needed. Other
compilers may not. The variables being set to zero is probably a coincidence.
It depends what was in memory when the program was compiled.
The problems caused by changing compilers are usually minor and can be easily
fixed. Developing with mingw is OK. But you need to compile and run it on the
compiler used by your class. Many open source programs are compiled with
several compilers to be sure they are error free.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm using Dev-C++ version 4.9.9.2 on Windows 7 64 bit for an intro to C++
class. The "problem" is, I can write code in Dev that compiles and runs
perfectly, but doesn't compile in Microsoft Visual Studio or g++. For example,
I forgot the #include <string> in one homework problem and it compiled and ran
perfectly, but I got very little credit for it because it didn't work in
Visual Studio or g++. Dev also seems to be automatically setting variables
equal to zero, which visual studio doesn't like either.
I looked through the faq's and didn't see anything that answered my question.
Any help would be appreciated.
Dev-Cpp uses the mingw compiler which is causing the problem.
It is not unusual for a program to have errors when you change compilers. You
should compile it with the compiler your class uses to be sure it works. Mingw
will automatically include headers if it can determine they are needed. Other
compilers may not. The variables being set to zero is probably a coincidence.
It depends what was in memory when the program was compiled.
The problems caused by changing compilers are usually minor and can be easily
fixed. Developing with mingw is OK. But you need to compile and run it on the
compiler used by your class. Many open source programs are compiled with
several compilers to be sure they are error free.