I started this program on a different computer. I saved all the files I needed and zipped them and e-mailed them to a different computer. When I got home I unzipped the folder and opened the source code, clicked 'compile and run' and got 161 errors :( . I don't know what the problem is because it worked fine with 0 errors before I changed computers. Here is the source code:
Compiler: Dev-C++ 4.9.9.2
Code:#include <fstream> #include <iostream> using namespace std; char YourName[10]; int input; char Race[15]; char NewChar() { cout <<"Please enter a name. No more than 15 characters and NO SPACES!!!" <<endl; cin >>YourName; cout <<endl; ofstream a_file ( "profile.txt"); a_file<<"Name = " <<YourName <<endl; cout <<"================Choose a race=================" <<endl; cout <<"| |" <<endl; cout <<"| [1.] Human |" <<endl; cout <<"| [2.] Enchanter |" <<endl; cout <<"| [3.] Brute |" <<endl; cout <<"| [4.] ??????? |" <<endl; cout <<"| [5.] ??????? |" <<endl; cout <<"| |" <<endl; cout <<"=============================================|" <<endl; cin>>input; switch (input){ case 1: //Race = "Human"; a_file<<"Race = Human" <<endl; cout <<"Text here"<<endl; cout <<"Text here." <<endl; cout <<"Text here."<<endl; cout <<"Text here." <<endl; cout <<"Racial bonus includes:"; cout <<" +100 hp's"; break; case 2: //Race = "Enchanter"; a_file<<"Race = Enchanter" <<endl; cout <<"Text here." <<endl; cout <<"Text here." <<endl; cout <<"Text here." <<endl; cout <<"Racial Bonus includes:"; cout <<" +100 mp's"; break; case 3: //Race = "Brute"; a_file<<"Race = Brute" <<endl; cout <<"Text here." <<endl; cout <<"Text here." <<endl; cout <<"Racial Bonus includes:"; cout <<" +10 Str, +100 hp's"; break; default: cout <<"Not an acceptable choice, please try again!"; break; } a_file.close(); } void LoadChar(); void Story(); void Options(); void StartGame() { cout <<"=======Welcome to the Age of Spire============" <<endl; cout <<"| |" <<endl; cout <<"| [1.] Create new Character |" <<endl; cout <<"| [2.] Load Character |" <<endl; cout <<"| [3.] Veiw Story/History |" <<endl; cout <<"| [4.] Options |" <<endl; cout <<"| [5.] Credits |" <<endl; cout <<"| |" <<endl; cout <<"=============================================|" <<endl; cin>>input; switch (input) { case 1: NewChar(); //cout <<"Create char screen" <<endl; break; case 2: //LoadChar(); cout <<"Load screen" <<endl; break; case 3: //Story(); cout <<"Show story" <<endl; break; case 4: cout <<"Sorry, not impletmented yet." <<endl; break; case 5: cout <<"Created by:*********" <<endl; cout <<" ************ " <<endl; break; default: cout <<"Not a valid imput please try again." <<endl; break; } } int main() { StartGame(); ifstream b_file ( "profile.txt" ); b_file >>YourName[10]; b_file.close(); cin.ignore(); cin.get(); }
And here is the compile log.
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Dev-C++\AoS test.cpp" -o "C:\Dev-C++\AoS test.exe" -g3 -I"C:\Dev-Cpp\include\c++" -I"C:\Dev-Cpp\include\c++\mingw32" -I"C:\Dev-Cpp\include\c++\backward" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -g3
In file included from C:/Dev-Cpp/include/c++/bits/basic_ios.h:41,
from C:/Dev-Cpp/include/c++/ios:51,
from C:/Dev-Cpp/include/c++/istream:44,
from C:/Dev-Cpp/include/c++/fstream:45,
from C:\Dev-C++\AoS test.cpp:1:
C:/Dev-Cpp/include/c++/bits/locale_facets.h: In constructor `std::numpunct_byname<_CharT>::numpunct_byname(con st char*, size_t)':
C:/Dev-Cpp/include/c++/bits/locale_facets.h:564: error: there are no arguments to `_S_create_c_locale' that depend on a template parameter, so a declaration of `_S_create_c_locale' must be available
C:/Dev-Cpp/include/c++/bits/locale_facets.h:564: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
C:/Dev-Cpp/include/c++/bits/locale_facets.h:565: error: there are no arguments to `_M_initialize_numpunct' that depend on a template parameter, so a declaration of `_M_initialize_numpunct' must be available
C:/Dev-Cpp/include/c++/bits/locale_facets.h: In destructor `virtual std::numpunct_byname<_CharT>::~numpunct_byname()':
C:/Dev-Cpp/include/c++/bits/locale_facets.h:571: error: there are no arguments to `_S_destroy_c_locale' that depend on a template parameter, so a declaration of `_S_destroy_c_locale' must be available
Execution terminated
I shortened the compile log down. It is a lot bigger but its mostly repeated stuff. My guess is that either my header files are messed up or that it has something to do with me changing computers.



LinkBack URL
About LinkBacks


