473,320 Members | 2,117 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Using namespace std and Error 19:

Hallo,
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>,a llocator>,basic_string<char,string_char_traits<cha r>,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;
^^^^^^^
Error 178: "CORBAManager.h", line 137 # Nonstatic member

"pair<basic_string<char,string_char_traits<char>,a llocator>,basic_string<char,string_char_traits<cha r>,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 697: "corbatest.cc", line 10 # Only namespace names are valid
here.
using namespace std;
^^^
Error 699: "corbatest.cc", line 10 # Error limit reached; halting
compilation.
using namespace std;
^^^
*** Error exit code 2

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

Below is part of the code that I have in one of the files
================================================== ===============
#include <fstream.h>
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
//---------------------------------------------------------------------------
namespace std{};
using namespace std;

using std::string;
using std::map;
using std::vector;
using namespace CORBAManagerDefinesNS;

namespace CORBAManagerNS{

class CORBAManager{

public:

// Singleton access functions
static CORBAManager* Instance();
static void Destroy();
static void RefreshIN(int sig_num);

// IN Corba Interface Initialisation

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

I must admit that I tried reading the some earlier posted messages in
this forum about the namespace issues and tried to implement the
suggestions offered, but the error are still there.

Please assist me in identifying the problem and also in providing the
solution.

Jul 23 '05 #1
5 5660

"Enos Meroka" <en*******@yahoo.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hallo,
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.

Below is part of the code that I have in one of the files
================================================== ===============
#include <fstream.h>
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
//--------------------------------------------------------------------------
- namespace std{};
using namespace std;

using std::string;
using std::map;
using std::vector;
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
Jul 23 '05 #2
On 24 Jan 2005 22:33:34 -0800, "Enos Meroka" <en*******@yahoo.com>
wrote:

[snip]

What is "Error 19"? The C++ standard does not define errors or
specific error numbers. It only requires "diagnostics", which might
include warnings, for certain situations.
Below is part of the code that I have in one of the files
================================================= ================
#include <fstream.h>
This should be <fstream> (without the .h)
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map> //---------------------------------------------------------------------------
namespace std{};
Totally unnecessary to do this...
using namespace std;
using std::string;
using std::map;
using std::vector;
using namespace CORBAManagerDefinesNS;


These are all big no-no's if placed in header files because you are
polluting the global namespace.

[the rest snipped]

--
Bob Hairgrove
No**********@Home.com
Jul 23 '05 #3
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..

Jul 23 '05 #4
Bob Hairgrove wrote:
[snip]

What is "Error 19"?
The original posting contains the answer to this question over a dozen
times.
The C++ standard does not define errors or specific error numbers. It only
requires "diagnostics", which might include warnings, for certain
situations.


You snip out the error messages and then you ask what they are?
using namespace std;
using std::string;
using std::map;
using std::vector;
using namespace CORBAManagerDefinesNS;


These are all big no-no's if placed in header files because you are
polluting the global namespace.


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

Jul 23 '05 #5
Rolf Magnus wrote:
[SNIP]
The original posting contains the answer to this question over a dozen
times. [SNIP] You snip out the error messages and then you ask what they are? [SNIP] That's a good advice, but doesn't seem to be related to the OP's problem.


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.
Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Petter Reinholdtsen | last post by:
I ran into a problem on HP-UX 11.00 the other day, where it refused to compile a program using 'using namespace std;' at the top. The reason seem to be that the compiler refuses to accept 'using...
4
by: Bart de Vries | last post by:
Hello, I new on developing with ASP.NET and i wrote some lines of code. This works fine when all the code is in one page, but when i split it up into and ASPX file and make an DLL using a...
14
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
8
by: acb | last post by:
Hi, I wrote a DLL Component (using Visual Studio 2005) and managed to include it into a C# Console application. I am now trying to include this component into a Web project. I copy the DLL...
3
by: Wayne Shu | last post by:
When I read the chapter of the namespace of the book C++ Primer(3e). It explain the using directive as follow: "A using directive makes the namespace member names visible as if they were declared...
1
by: --== Alain ==-- | last post by:
Hi I've create a C++ managed Class as : *.h file -------- #pragma once #include "afxcmn.h" using namespace System::Design; using namespace System::Drawing::Design; using namespace...
2
by: lewisms | last post by:
Hello all, I am quite new to c++/. Net so please don't shoot me down for being a newbie. Any way I am trying to make a simple multithreading program that is just to learn the ideas behind it...
4
by: quophyie | last post by:
Hi guys I''m a new C++ programmer and I am having a few problems with some structs that I have defined in my header file and want to use in my CPP file. The struct called "deck" is defined in a...
3
by: David K in San Jose | last post by:
I'm using managed (CLR) C++ in VS2005 to create a Windows app that contains a form named "MyForm". In the code for that form I'm trying to invoke some static functions by using an array of function...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.