Jump to content
  • Advertisement
Sign in to follow this  
ashstampede

[SOLVED]namespace troubles

This topic is 4036 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, in implementing my own namespace with my classes and trying to rebuild what i already have; I ended up getting some 800 odd errors from the same files and same functions which belong to cstidlib and cstido and have copied some of the build logs errors at the bottom. So i need a bit of help as i take it I have not used the namespace correctly when creating my own. i have got my own namespace like so in all my cpp and header files except for my main.h and main.cpp code for my header files look like so
#ifndef THISCLASS_H
#define THISCLASS_H

//any includes i need
#include "that.h"

namespace stampede
{
 class thisClass
 {
 };
}//end namespace

#endif
code for any cpp looks like this
#include "thisClass.h"
namespace stampede
{
 thisClass::thisClass()
 {
 }
}//end namespace
then in my main.cpp at the top i just go
using namespace stampede;
here is just a copy of a section of the build log and the error that gets repeated from my other files, but starts after the main file is attempted at being compiled
c:\program files\microsoft visual studio 8\vc\include\cstdio(25) : error C2039: 'fpos_t' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(25) : error C2873: 'fpos_t' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(25) : error C2039: 'FILE' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(25) : error C2873: 'FILE' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(26) : error C2039: 'clearerr' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(26) : error C2873: 'clearerr' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(26) : error C2039: 'fclose' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(26) : error C2873: 'fclose' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(26) : error C2039: 'feof' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(26) : error C2873: 'feof' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(27) : error C2039: 'ferror' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(27) : error C2873: 'ferror' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(27) : error C2039: 'fflush' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(27) : error C2873: 'fflush' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(27) : error C2039: 'fgetc' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(27) : error C2873: 'fgetc' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(28) : error C2039: 'fgetpos' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(28) : error C2873: 'fgetpos' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(28) : error C2039: 'fgets' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(28) : error C2873: 'fgets' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(28) : error C2039: 'fopen' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(28) : error C2873: 'fopen' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(29) : error C2039: 'fprintf' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(29) : error C2873: 'fprintf' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(29) : error C2039: 'fputc' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(29) : error C2873: 'fputc' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(29) : error C2039: 'fputs' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(29) : error C2873: 'fputs' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(30) : error C2039: 'fread' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(30) : error C2873: 'fread' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(30) : error C2039: 'freopen' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(30) : error C2873: 'freopen' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(30) : error C2039: 'fscanf' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(30) : error C2873: 'fscanf' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(31) : error C2039: 'fseek' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(31) : error C2873: 'fseek' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(31) : error C2039: 'fsetpos' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(31) : error C2873: 'fsetpos' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(31) : error C2039: 'ftell' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(31) : error C2873: 'ftell' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(32) : error C2039: 'fwrite' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(32) : error C2873: 'fwrite' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(32) : error C2039: 'getc' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(32) : error C2873: 'getc' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(32) : error C2039: 'getchar' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(32) : error C2873: 'getchar' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(33) : error C2039: 'gets' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(33) : error C2873: 'gets' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(33) : error C2039: 'perror' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(33) : error C2873: 'perror' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(34) : error C2039: 'putc' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(34) : error C2873: 'putc' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(34) : error C2039: 'putchar' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(34) : error C2873: 'putchar' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(35) : error C2039: 'printf' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(35) : error C2873: 'printf' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(35) : error C2039: 'puts' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(35) : error C2873: 'puts' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(35) : error C2039: 'remove' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(35) : error C2873: 'remove' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(36) : error C2039: 'rename' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(36) : error C2873: 'rename' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(36) : error C2039: 'rewind' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(36) : error C2873: 'rewind' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(36) : error C2039: 'scanf' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(36) : error C2873: 'scanf' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(37) : error C2039: 'setbuf' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(37) : error C2873: 'setbuf' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(37) : error C2039: 'setvbuf' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(37) : error C2873: 'setvbuf' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(37) : error C2039: 'sprintf' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(37) : error C2873: 'sprintf' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(38) : error C2039: 'sscanf' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(38) : error C2873: 'sscanf' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(38) : error C2039: 'tmpfile' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(38) : error C2873: 'tmpfile' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(38) : error C2039: 'tmpnam' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(38) : error C2873: 'tmpnam' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(39) : error C2039: 'ungetc' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(39) : error C2873: 'ungetc' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(39) : error C2039: 'vfprintf' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(39) : error C2873: 'vfprintf' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(39) : error C2039: 'vprintf' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(39) : error C2873: 'vprintf' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdio(40) : error C2039: 'vsprintf' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdio(40) : error C2873: 'vsprintf' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdlib(18) : error C2039: 'div_t' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdlib(18) : error C2873: 'div_t' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdlib(18) : error C2039: 'ldiv_t' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdlib(18) : error C2873: 'ldiv_t' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdlib(20) : error C2039: 'abort' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdlib(20) : error C2873: 'abort' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdlib(20) : error C2039: 'abs' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdlib(20) : error C2873: 'abs' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdlib(21) : error C2039: 'atof' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdlib(21) : error C2873: 'atof' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdlib(21) : error C2039: 'atoi' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdlib(21) : error C2873: 'atoi' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdlib(21) : error C2039: 'atol' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdlib(21) : error C2873: 'atol' : symbol cannot be used in a using-declaration
c:\program files\microsoft visual studio 8\vc\include\cstdlib(22) : error C2039: 'bsearch' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdlib(22) : fatal error C1003: error count exceeds 100; stopping compilation
[Edited by - ashstampede on October 1, 2007 6:08:23 PM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!