dear all,i have a problem in compiling ..
my program consists of main.cpp ,a.cpp,b.h,and c.cpp
i can successfully build a.exe by compiling main.cpp ,a.cpp and b.h using VC++
but fail to compile c.cpp
WHAT MAKES ME laugh is tat i can build c.exe in Dev-C++.cpp, but fail to compile the main.cpp ,a.cpp and b.h in DEV-C++ (HOLYSXXT)
might anyone give me how to "equalize" the compilers in VC and DEV-C++ so that i can build the 4 sub-programmes in one of the 2 softwares.
WHAT r the settings?library?! header files!?
so i can build a COMPLETE program ,THZ VERYVERY MUCH
Look for the following:
* Deprecated headers such as iostream.h, and stdio.h. All C++ standard headers have no extension.
* Variables scope:
1 2 3 4 5 6 7 8 9 10 11 12 13
for (int i=0;/*...*/){
//...
}
//...
//v Legal in VC++ 6.0, illegal in MinGW (Dev-C++).
for (i=0;/*...*/){
//...
}
//...
//v Illegal in VC++ 6.0, legal in MinGW.
for (int i=0;/*...*/){
//...
}
The reason for this is that, according to the C++ standard that was in effect back when VC++ was released, variables declared in an inner block didn't go out of scope when the block ended, to for counters were declared only once.
The version of MinGW that comes with Dev-C++ uses a newer version of the standard. According to it, variables go out of scope when the block they were declared in, ends.