i wrote the following program
.
#include <string>
.
.
string myString = "dev";
. (etc)
in win/dev/g++ it works fine
in linux/gcc it does not compile because it does not know about strings.
can anyone help?
thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You are using the gcc in linux ?. It is the gcc that has been ported to windows ( mingw ) that Dev uses. Now without the rest of the code to see i will ask you a question, because strings don't live alone, does your windows code have any specific windows OS calls ect, if so you will need to do two things.
1. remove the specific windows code into a file of it's own.
This will be true for the linux code as well.
2. The rest of your code keep with standard C or C++ ( whatever your lnaguage of choice is ) because this ( 99%) will port over.
And just an extra: Use the newer gcc out, that way your code remains up to date.
:<mi~
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thank you for your reply
i am using gcc in linux to test the code before it is turned in at school and compiled on unix/gcc. we are to use strict ansi and there are no specific os commands or gui...it is a data strucures class. this particular program is about half a page just to play with unix/c++ before it counts. the big problem is if i can't get a ansi standard class to work, how am i to get my own classes to work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thank you for your reply
i am using gcc in linux to test the code before it is turned in at school and compiled on unix/gcc. we are to use strict ansi and there are no specific os commands or gui...it is a data strucures class. this particular program is about half a page just to play with unix/c++ before it counts. the big problem is if i can't get a ansi standard class to work, how am i to get my own classes to work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thank you for your reply
i am using gcc in linux to test the code before it is turned in at school and compiled on unix/gcc. we are to use strict ansi and there are no specific os commands or gui...it is a data strucures class. this particular program is about half a page just to play with unix/c++ before it counts. the big problem is if i can't get a ansi standard class to work, how am i to get my own classes to work.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i wrote the following program
.
#include <string>
.
.
string myString = "dev";
. (etc)
in win/dev/g++ it works fine
in linux/gcc it does not compile because it does not know about strings.
can anyone help?
thank you
You are using the gcc in linux ?. It is the gcc that has been ported to windows ( mingw ) that Dev uses. Now without the rest of the code to see i will ask you a question, because strings don't live alone, does your windows code have any specific windows OS calls ect, if so you will need to do two things.
1. remove the specific windows code into a file of it's own.
This will be true for the linux code as well.
2. The rest of your code keep with standard C or C++ ( whatever your lnaguage of choice is ) because this ( 99%) will port over.
And just an extra: Use the newer gcc out, that way your code remains up to date.
:<mi~
thank you for your reply
i am using gcc in linux to test the code before it is turned in at school and compiled on unix/gcc. we are to use strict ansi and there are no specific os commands or gui...it is a data strucures class. this particular program is about half a page just to play with unix/c++ before it counts. the big problem is if i can't get a ansi standard class to work, how am i to get my own classes to work.
thank you for your reply
i am using gcc in linux to test the code before it is turned in at school and compiled on unix/gcc. we are to use strict ansi and there are no specific os commands or gui...it is a data strucures class. this particular program is about half a page just to play with unix/c++ before it counts. the big problem is if i can't get a ansi standard class to work, how am i to get my own classes to work.
thank you for your reply
i am using gcc in linux to test the code before it is turned in at school and compiled on unix/gcc. we are to use strict ansi and there are no specific os commands or gui...it is a data strucures class. this particular program is about half a page just to play with unix/c++ before it counts. the big problem is if i can't get a ansi standard class to work, how am i to get my own classes to work.
i found the problem. i was lacking the line
using namespace std;
it is still interesting that win/dev did just fine while
linux/gcc had to have that line.
GCC 2.95 does not support namespaces, GCC 3.2 does. The latest MinGW is 3.2.
Type gcc -v at the command line to check your version.