Suggestions for converting a Visual C++ program to g++. ------------------------------------------------------- I just worked through the conversion process with a student. Some things we noted were: - Visual C++ may not include a newline in the last line of the .cpp file. You should add an extra blank line at the end of all your .cpp and .h files. - If that does not make the warning about "incomplete last line" go away, look at the file in replit and add a blank line to it. - By default, Visual C++ adds a line #include "stdafx.h" to your program that includes various headers. This line should be commented out. For g++, you must explicitly show the #includes that you need. At the beginning of your main file you should have something like: #include // needed for cin and cout #include // needed for setw #include // needed for file input output #include // allows you to use the string type using namespace std; #include // C standard library functions (atoi). Sometimes you may want more C language libraries ... #include // C standard input and output (scanf, printf) #include // C string library, which is != . You should also add this information at the top of your other .cpp files. You can delete lines that you know to be irrelevant. For example, if you are not using the C string library functions, you don't have to include . Your .cpp files should not include other .cpp files. You should only include .h files. To compile a program with several files together, use: g++ file1.cpp file2.cpp file3.cpp -o myprog or if all the .cpp files in the directory are relevant: g++ *.cpp -o myprog ------------------------------ - If your program compiles cleanly with g++, you can also try clang (another compiler) to see if it finds some errors that the other compiler missed. However, it is sufficient if your program compiles and runs correctly with either compiler! - If you have any other suggestions for helping to convert from one environment to the other, please let me know and I will add them to this list. Send email via UR Courses. - If you absolutely can't get your program to compile on replit, you should submit it anyhow and put in your compile.txt that it has to be compiled on Visual C++. I will discuss this problem with the marker.