Originally Posted by
onemanclapping
what do you mean by "create the makefiles for each os"? sorry, I'm a bit of a noob :/
I did:
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
void clearScreen()
{
#ifdef _WIN32
system("cls");
#elif defined(_UNIX)
system("clear");
#endif
}
int main()
{
cout << "coco" << endl;
cin.get();
clearScreen();
cout << "coco2" << endl;
}
and the result:
omc@linus-marx:~$ /home/omc/workspace/LigaSagres/Debug/LigaSagres
coco
coco2
omc@linus-marx:~$
so it didn't work. I guess maybe because I have not created "the makefiles for each os"
What do you mean by "it didn't work" ? I don't know what that stuff is that you posted.
"makefile for each os" means that you have to compile your program in each os -- once under *nix and again under MS-Windows. You can't compile once and run on both operating systems -- that won't work.
If you use g++ compiler then you can probably have one source file and use the same compiler on both os. You will need a version of g++ for unix and another version of g++ for MS-Windows.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.