Using namespace std and Error 19:

Using namespace std and Error 19:

Post by Enos Merok » Wed, 26 Jan 2005 15:33:34


allo,
I am a student doing my project in the university.. I have been trying
to compile the program using HP -UX aCC compiler, however I keep on
getting the following errors.

=================================================================

Error 19: "CORBAManagerMessages.h", line 4 # Unexpected 'std'.
using std::string;
^^^
Error 19: "CORBAManagerMessages.cc", line 3 # Unexpected 'std'.
using std::string;
^^^
CORBAManagerDefines.cc:
Error 19: "CORBAManagerDefines.h", line 7 # Unexpected 'std'.
using std::string;
^^^
Error 19: "CORBAManagerDefines.cc", line 3 # Unexpected 'std'.
using std::string;
^^^
CORBAManager.cc:
Error 19: "CORBAManagerMessages.h", line 4 # Unexpected 'std'.
using std::string;
^^^
Error 19: "CORBAManagerDefines.h", line 7 # Unexpected 'std'.
using std::string;
^^^
Error 19: "CORBAManager.h", line 31 # Unexpected 'std'.
using std::string;
^^^
Error 19: "CORBAManager.h", line 32 # Unexpected 'std'.
using std::map;
^^^
Error 19: "CORBAManager.h", line 33 # Unexpected 'std'.
using std::vector;
^^^
Error 20: "CORBAManager.h", line 104 # ';' expected before '::'.
typedef std::pair<servanttype,service> paired_key;
^^
Error (future) 600: "CORBAManager.h", line 104 # Type specifier is
omitted; "int" is no longer assumed.
typedef std::pair<servanttype,service> paired_key;
^^^^^^^
Error 178: "CORBAManager.h", line 137 # Nonstatic member

"pair<basic_string<char,string_char_traits<char>,allocator>,basic_string<char,string_char_traits<char>,allocator>
CORBAManagerNS::CORBAManager::paired_key" is referenced in a nested
class, local class or static member initializer.
map<paired_key,serviceior> iortable;
^^^^^^^^^^
Error 321: "CORBAManager.h", line 137 # A type argument was expected in
the specialization of template 'map'.
map<paired_key,serviceior> iortable;
^^^^^^^^^^
Error 343: "CORBAManager.h", line 93 # Class object 'iortable' neither
appears in base/member initializer list nor has a default
constructor.
CORBAManager():bSetUsername(false){}
^^^^^^^^^^^^
Error 112: "CORBAManager.cc", line 25 # Include file <sstream> not
found.
#include <sstream>
^^^^^^^^^
Error 112: "CORBAManager.cc", line 26 # Include file <iostream> not
found.
#include <iostream>
^^^^^^^^^^
Error 19: "CORBAManager.cc", line 29 # Unexpected 'std'.
using std::string;
^^^
Error 699: "CORBAManager.cc", line 29 # Error limit reached; halting
compilation.
using std::string;
^^^
corbatest.cc:
Error 112: "corbatest.cc", line 1 # Include file <iostream> not found.
#include <iostream>
^^^^^^^^^^
Error 112: "corbatest.cc", line 2 # Include file <sstream> not found.
#include <sstream>
^^^^^^^^^
Error 19: "CORBAManagerDefines.h", line 7 # Unexpected 'std'.
using std::string;
^^^
Error 19: "CORBAManagerMessages.h", line 4 # Unexpected 'std'.
using std::string;
^^^
Error 19: "CORBAManager.h", line 31 # Unexpected 'std'.
using std::string;
^^^
Error 19: "CORBAManager.h", line 32 # Unexpected 'std'.
using std::map;
^^^
Error 19: "CORBAManager.h", line 33 # Unexpected 'std'.
using std::vector;
^^^
Error 20: "CORBAManager.h", line 104 # ';' expected before '::'.
typedef std::pair<servanttype,service> paired_key;
^^
Error (future) 600: "CORBAManager.h", line 104 # Type specifier is
omitted; "int" is no longer assumed.
typedef std::pair<servanttype,service> paired_key
 
 
 

Using namespace std and Error 19:

Post by Senapathy » Wed, 26 Jan 2005 17:06:23


//--------------------------------------------------------------------------
-

I don't know about compiler specific implementations, but your code compiles
in MS VC 6 compiler.
However, I think there are certain changes that you can try:

1) The usage
> namespace std{};
seems suspicious.
std is a namespace defined in your STL headers. There is no need to define
it again here.

2) After the "using namespace::std" directive the rest of the using
declarations are superfluous. (the using declarations are preferable to the
using directive)

Senapathy

 
 
 

Using namespace std and Error 19:

Post by Enos Merok » Wed, 26 Jan 2005 20:12:32

Thanks for the response, I am using the aCC compiler in HP-UX, I have
followed the advise given by Senapathy and Bob Hairgrove, and the error
have reduced, but still majority of the errors are there.

The above piece of code compiled and ran well in gcc solaris.
It seems that it is not able to get the header files..
 
 
 

Using namespace std and Error 19:

Post by Rolf Magnu » Wed, 26 Jan 2005 20:26:54


The original posting contains the answer to this question over a dozen
times.


You snip out the error messages and then you ask what they are?


That's a good advice, but doesn't seem to be related to the OP's problem.
 
 
 

Using namespace std and Error 19:

Post by White Wol » Thu, 27 Jan 2005 05:25:23


[SNIP]
[SNIP]
[SNIP]

And yet, his post contained the same amount of help to the OP and even a bit
less amount of waste of bandwidth than yours. But hey, we know now you have
a strong ego, so next time we will just ignore.

(Yes, I have my S hole bit stuck today.)


--
WW aka Attila
:::
I read the FM, and it didn't work.