473,890 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Namespace error

Hello,
I am trying to compile this "hello world" program but it gives me this
following error,
"A namespace does not directly contain members such as fields or methods"
Can someone pelse help me with this?
Here's my code:
Using System;

namespace Helloworld
{
class Helloworldindos
{
static void Main()
{
Console.WriteLi ne("Hello World");
}
}
}
Nov 15 '05 #1
3 1830
Dharma <t-******@microsof t.com.NO_SPAM> wrote:
Hello,
I am trying to compile this "hello world" program but it gives me this
following error,
"A namespace does not directly contain members such as fields or methods"
Can someone pelse help me with this?
Here's my code: Using System;


This line is the problem. C# is case-sensitive - that should be
"using" rather than "Using".

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
Thanks Jon
"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com...
Dharma <t-******@microsof t.com.NO_SPAM> wrote:
Hello,
I am trying to compile this "hello world" program but it gives me this following error,
"A namespace does not directly contain members such as fields or methods" Can someone pelse help me with this?
Here's my code:

Using System;


This line is the problem. C# is case-sensitive - that should be
"using" rather than "Using".

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #3
1On Thu, 27 Nov 2003 12:24:42 -0500, "Dharma"
<t-******@microsof t.com.NO_SPAM> wrote:
Thanks Jon
"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:MP******* *************** **@msnews.micro soft.com...
Dharma <t-******@microsof t.com.NO_SPAM> wrote:
> Hello,
> I am trying to compile this "hello world" program but it gives methis > following error,
> "A namespace does not directly contain members such as fields ormethods" > Can someone pelse help me with this?
> Here's my code:

> Using System;


This line is the problem. C# is case-sensitive - that should be
"using" rather than "Using".

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


I'm also at the "Hello World" phase of learning C#..

Memorizing the proper case for various keywords looks like it will
take a bit of time!

Gonna make a good go at it though :)

Tony!
Nov 15 '05 #4

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

Similar topics

5
5730
by: Enos Meroka | last post by:
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; ^^^
2
4399
by: Bryan Parkoff | last post by:
MPU_Group is the namespace and MPU is the struct. Three members: A, B, and C are in the MPU struct inside MPU_Group namespace. I tried to compile, but it shows error saying MPU struct is not member in MPU_Group namespace. Here is my code below. Please advise how to fix error? // Load.h namespace MPU_GROUP { struct _MPU {
6
555
by: clinton__bill | last post by:
Hi, I usually use "using namespace <namespace_name>" to reference a namespace. Today I run across a code, in its header file it has this, namespace SP1{ class C1; } While SP1::C1 is a namespace::class declared and defined somewhere else. It seems the above 3 lines is similar to "using namespace SP1;",
2
7522
by: Tony Johansson | last post by:
Hello! I'm reading a book about C++ and there is something that I don't understand so I ask you. Below I have the text from the book and the code from the file where main is located and some namespace definition with class definitions. The book says "C++ has a global anonymous namespace that is similar to Java's global anonymous package. All declarations not explicitly placed in named
0
1308
by: Tressa | last post by:
Sorry to be such a novice about this but..... I have a windows service. It contains two separate files. Both have the same namespace name. I need to pass "bDisplay" into the other file. I am getting several errors and not sure why or how to solve them does anyone have any help? How do I access the other file? ServerSocket.cs *This is where the main server start is so the" private bool m_bIsDisplayed = false;" had to go here so it...
5
14060
by: Genboy | last post by:
My "VIS" Website, which is a C# site created in VS.NET, Framework 1.1, is no longer compiling for me via the command line. As I have done 600 times in the last year and a half, I can compile to VIS.DLL via Visual Studio, with no problems: ------ Rebuild All started: Project: VIS, Configuration: Debug .NET ------ Preparing resources... Updating references...
12
8573
by: Plop69 | last post by:
need some help on following: xml file 1 <TEST xmlns="http://test" > <OK>mlkddflmkj</OK> </TEST>
3
2882
by: sjt003 | last post by:
I have been developing web apps in Visual Studio 2003, but since the other developers in my office don't use Visual Studio, I may have to stop too unless there is an efficient way for them to compile the code outside of Visual Studio if they need to adjust something I created. I have been trying to use vbc.exe, but I'm having problems with references to the DataSet I have created. Multiple pages reference my dataset - "DataSet1", ......
5
1454
by: michael.d.pedersen | last post by:
Hello group, I am new to Visual C++ 8 and have a seemingly trivial problem using namespaces. The scenario: I have two classes, TestClass1 and TestClass2, in the namespace Test. I would like to create a reference to TestClass2 in TestClass1; but the compiler doesn't seem to recognize the namespace Test and any classes in it. Here are my class definitions and declarations:
2
6805
by: sushilkaushik | last post by:
In my VC++ project (using Visual Studio 2005) I have two DLLs : CommonClasses.dll and CheckIn.dll I added both of them in exactly the same way. First, CommonClesses and then CheckIn, using Project->References Added the header files from both the DLLs into my project. Set the Include_Dir and Reference_Dir to the header file and DLL location respectively. I have this in one of my project file: #include "Helpers.h" // from...
0
9976
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9815
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11215
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10801
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10904
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9616
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7159
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6034
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4258
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.