tistklehoff
Programmer
Hello all. I've a problem with a program compiled in my work-machine under win2k with Dev-C++ (gcc compiler).
It works perfectly in my computer, but I need to run it in a server, running under UNIX O.S.
My UNIX compiler is aCC. I'm trying to compile, but aCC throws one error:
Error 697: "main.cpp", line 8 # Only namespace names are valid here.
using namespace std;
^^^
Next, some errors like this:
Error 187: "main.cpp", line 49 # Referenced object 'is_open' is not a member
of class ifstream ["/opt/aCC/include/iostream/fstream.h", line 78].
if (!prop_file.is_open()){
^^^^^^^
I tried many different options in aCC, reading man entries, but don't work...
My aCC is in /opt/aCC (/bin exe file, /include and /include_std inc files), compiler order: aCC file.cpp, aCC -I /opt/aCC/include file.cpp, and many others
header files:
#include <iostream>
#include <string>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <cstdio>
using namespace std;
...
if I take old C headers (iostream.h, stdlib.h and so on) throws the same error list, if I erase namespace clause, throws many errors like: cout is not defined in current namespace, string is not defined in current namespace...
Thankyou all (and sorry for my english, it is not too good)
It works perfectly in my computer, but I need to run it in a server, running under UNIX O.S.
My UNIX compiler is aCC. I'm trying to compile, but aCC throws one error:
Error 697: "main.cpp", line 8 # Only namespace names are valid here.
using namespace std;
^^^
Next, some errors like this:
Error 187: "main.cpp", line 49 # Referenced object 'is_open' is not a member
of class ifstream ["/opt/aCC/include/iostream/fstream.h", line 78].
if (!prop_file.is_open()){
^^^^^^^
I tried many different options in aCC, reading man entries, but don't work...
My aCC is in /opt/aCC (/bin exe file, /include and /include_std inc files), compiler order: aCC file.cpp, aCC -I /opt/aCC/include file.cpp, and many others
header files:
#include <iostream>
#include <string>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <cstdio>
using namespace std;
...
if I take old C headers (iostream.h, stdlib.h and so on) throws the same error list, if I erase namespace clause, throws many errors like: cout is not defined in current namespace, string is not defined in current namespace...
Thankyou all (and sorry for my english, it is not too good)