ok so i wrote my code in Borland C++ and everything worked just perfectly...now i have to submit my assignment using sunfire and so i had to compile on linux using this command:
g++ -c astar.cpp
and i'm getting like loads of errors...i don't know why this is happening...is it because of compiler differences...
anyway the most prominent errors are:
- string was not declared in this scope
this is when i declare a string like this:
string something;
and actually it's about all variable declarations mostly...i don't get i...in one case i pass a float x to a function and when i use it in that function it says that this float is not defined!
what's going on...can someone help me with proper ways to declare this in the g++ environment...
Regards,
Farooq
Here are some of the errors:
Code:
astar.cpp:21: syntax error before `,'
astar.cpp:84: syntax error before `;'
astar.cpp:85: `string' was not declared in this scope
astar.cpp:85: template argument 1 is invalid
astar.cpp:85: template argument 1 is invalid
astar.cpp:85: template argument 2 is invalid
astar.cpp:85: ANSI C++ forbids declaration `CityConnections' with no type
astar.cpp:90: syntax error before `;'
astar.cpp:135: `string' was not declared in this scope
astar.cpp:135: template argument 1 is invalid
astar.cpp:135: template argument 1 is invalid
astar.cpp:135: template argument 3 is invalid
astar.cpp:135: ANSI C++ forbids declaration `CityNode' with no type
astar.cpp:217: `string' was not declared in this scope
astar.cpp:217: parse error before `,'
astar.cpp: In method `void Astar::readFile(char *)':
astar.cpp:140: `string' undeclared (first use this function)
astar.cpp:140: (Each undeclared identifier is reported only once