Hi,
I am having problems with my C++ Programs on Sun Solaris server since I have upgraded my C++ compiler from Sun Forte Developer 7 compiler to Sun Studio 9 C++ complier 5.6.
I have my own string class which I had issues but now compiles ok after puting option -library=iostream in my makefile.
My string library make file has " /opt/SUNWspro/bin/CC -g -xs -xar -library=iostream -YP " options wwhile compiling.
After creating my libraries, I compiled my main C++ program, which compiles OK but when I execute I get following error.
"getfile: syntax error at line 2 : `newline or ;' unexpected"
getfile.c is my c++ program which has following code at the start.
-------------------------------------------------
#include <stdlib.h>
#include <unistd.h>
#include <ctype.h>
#include <iostream.h>
#include <cmqc.h>
#define _REENTRANT
#include <string.h>
#include <wait.h>
#include <sys/wait.h>
-----------------------------------------------------
I can't understand where in line 2 I am having errors.
If I remove _REENTRANT then I get the following error
"The function "strtok_r" must have a prototype." which I have used in my code in the same getfile.c program.
Any suggestions comments will be very much appreciated.
Thanks
Ravi