473,385 Members | 1,934 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,385 software developers and data experts.

Repeated Namespace Declaration

Hi all, I'm having trouble with VC++.

I have a namespace, named Compiler (I'm building one at university).
Some classes appear to be defined in Compiler::Compiler::Compiler or
just Compiler::Compiler.

It seems I'm having trouble with "#include ..." and "using namespace
Compiler;" declarations; When removing all "using namespace Compiler;"
since I'm inside the namespace Compiler I have some error as
unrecognized classes objects and stuff.

Any Suggestions?

More Info:

Many files use classes defined on other files. I'm not sure how to use
correctly the "#include ...". Just one time in the whole namespace?, in
every file that uses that file?, etc.

The project WORKS (good and without warnings) when I use "using
namespace Compiler;" but with the Compiler::Compiler::Compiler thing. I
just want to correct this issue for learning.

Thanks

Sep 10 '06 #1
1 1127

"Leonel Galan" <le*********@gmail.comwrote in message
news:11**********************@d34g2000cwd.googlegr oups.com...
Hi all, I'm having trouble with VC++.

I have a namespace, named Compiler (I'm building one at university).
Some classes appear to be defined in Compiler::Compiler::Compiler or
just Compiler::Compiler.
have anything looking like this?

namespace Compiler
{
#include <xyz.h>
};

xyz.h:
namespace Compiler
{
....
};

Make sure your #includes are outside the namespace scope to avoid nesting.
Sep 11 '06 #2

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

Similar topics

8
by: Simon Brooke | last post by:
I was debugging a new XML generator tonight and trying to determine why it wasn't working; and realised my dom printer does not output XML namespace declarations. My method to output an Element...
9
by: Ivan Mascovich | last post by:
Previous posts (and compilers) confirm that class X { friend void Y() ; } ; does not match namespace
1
by: toton | last post by:
Hi, I have two namespace contains class InkFrame and PrefDialog respectively. PrefDialog needs InkFrame to show the dialog over the frame. It also stores a pointer to InkFrame inside it. Now I...
9
by: vthomasset | last post by:
Hi, Sorry for the bad subject, but i couldn't figure a better one. I would like to understand why a variable declared non static in a header causes multiple symbol definitions (if included in...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.