Some Problems

closed account (z1CpDjzh)
My API rewrite is not going well... getting some problems...

Errors:
Error	1	error C2039: 'Events' : is not a member of 'NNewPDL'	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	8	1	NewPDL
Error	2	error C2146: syntax error : missing ';' before identifier 'O_Events'	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	8	1	NewPDL
Error	3	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	8	1	NewPDL
Error	4	error C3083: 'Events': the symbol to the left of a '::' must be a type	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	9	1	NewPDL
Error	5	error C2039: 'Input' : is not a member of 'NNewPDL'	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	9	1	NewPDL
Error	6	error C2146: syntax error : missing ';' before identifier 'O_Input'	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	9	1	NewPDL
Error	7	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	9	1	NewPDL
Error	8	error C3083: 'Events': the symbol to the left of a '::' must be a type	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	10	1	NewPDL
Error	9	error C3083: 'Input': the symbol to the left of a '::' must be a type	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	10	1	NewPDL
Error	10	error C2039: 'Keyboard' : is not a member of 'NNewPDL'	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	10	1	NewPDL
Error	11	error C2146: syntax error : missing ';' before identifier 'O_Keyboard'	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	10	1	NewPDL
Error	12	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	c:\users\ahmed\documents\visual studio 2012\projects\newpde\newpdl\NewPDL.hpp	10	1	NewPDL
Error	13	error C2039: 'Events' : is not a member of 'NNewPDL'	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	8	1	NewPDE
Error	14	error C2146: syntax error : missing ';' before identifier 'O_Events'	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	8	1	NewPDE
Error	15	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	8	1	NewPDE
Error	16	error C3083: 'Events': the symbol to the left of a '::' must be a type	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	9	1	NewPDE
Error	17	error C2039: 'Input' : is not a member of 'NNewPDL'	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	9	1	NewPDE
Error	18	error C2146: syntax error : missing ';' before identifier 'O_Input'	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	9	1	NewPDE
Error	19	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	9	1	NewPDE
Error	20	error C3083: 'Events': the symbol to the left of a '::' must be a type	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	10	1	NewPDE
Error	21	error C3083: 'Input': the symbol to the left of a '::' must be a type	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	10	1	NewPDE
Error	22	error C2039: 'Keyboard' : is not a member of 'NNewPDL'	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	10	1	NewPDE
Error	23	error C2146: syntax error : missing ';' before identifier 'O_Keyboard'	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	10	1	NewPDE
Error	24	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int	C:\Users\Ahmed\Documents\Visual Studio 2012\Projects\NewPDE\NewPDL\NewPDL.hpp	10	1	NewPDE
Thos errors are right out of my compiler you see... freshly baked!

closed account (z1CpDjzh)
My Files:
Config.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//Config.hpp  : Configurations

//Code Starts Here:

//Checking for Visual C++... I don't want to memorize how _MSC_VER is spelt.
#ifdef _MSC_VER
#define VCPP
#endif

//Your OS is important
#if defined(_WIN32) || defined(__WIN32__)
   
        // Windows
        #define NewPDL_SYSTEM_WINDOWS
        #ifndef NOMINMAX
            #define NOMINMAX
        #endif
    
    #elif defined(linux) || defined(__linux)
    
        // Linux
        #define NewPDL_SYSTEM_LINUX
    	#error This operating system is not supported yet by NewPDL library

    #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
    
        // MacOS
        #define NewPDL_SYSTEM_MACOS
    	#error This operating system is not supported yet by NewPDL library

    #else
    
        // Unsupported system
        #error This operating system is not supported yet by NewPDL library
    
    #endif
    
    
    // Define a portable debug macro
    #if !defined(NDEBUG)
   
        #define NewPDL_DEBUG
    
    #endif


    
    // Define helpers to create portable import / export macros for each module
    #if !defined(NewPDL_STATIC)
    
        #if defined(NewPDL_SYSTEM_WINDOWS)
    
            // Windows compilers need specific (and different) keywords for export and import
			#ifdef NewPDL_EXPORTS
				#define NewPDL_DLL __declspec(dllexport)
			#else
				#define NewPDL_DLL __declspec(dllimport)
			#endif

    
            // For Visual C++ compilers, we also need to turn off this annoying C4251 warning
            #ifdef VCPP
    
                #pragma warning(disable : 4251)
    
            #endif
    
        #else // Linux,  Mac OS X
    
           #if __GNUC__ >= 4
   
               // GCC 4 has special keywords for showing/hiding symbols,
               // the same keyword is used for both importing and exporting
               #define NewPDL_API_EXPORT __attribute__ ((__visibility__ ("default")))
   
           #else
   
               // GCC < 4 has no mechanism to explicitly hide symbols, everything's exported
               #define NewPDL_API_EXPORT
   
           #endif
  
       #endif
   
   #else
   
       // Static build doesn't need import/export macros
       #define NewPDL_API_EXPORT
  
   #endif
   
   // Define portable fixed-size types
   namespace  NNewPDL
   {
       // All "common" platforms use the same size for char, short and int
       // (basically there are 3 types for 3 sizes, so no other match is possible),
       // we can use them without doing any kind of check
   
       // 8 bits integer types
       typedef signed   char Int8;
       typedef unsigned char Uint8;
   
       // 16 bits integer types
       typedef signed   short Int16;
       typedef unsigned short Uint16;
   
       // 32 bits integer types
       typedef signed   int Int32;
       typedef unsigned int Uint32;
   
       // 64 bits integer types
       #if defined(_MSC_VER)
           typedef signed   __int64 Int64;
           typedef unsigned __int64 Uint64;
       #else
           typedef signed   long long Int64;
           typedef unsigned long long Uint64;
       #endif

   } // namespace NNewPDL
   
   
 

Includes.hpp:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//C Library

#include <cassert>
#include <cctype> 
#include <cerrno> 
#include <cfloat> 
#include <ciso646> 
#include <climits> 
#include <clocale> 
#include <cmath> 
#include <csetjmp> 
#include <csignal>
#include <cstdarg> 
#include <cstddef> 
#include <cstdint> 
#include <cstdio> 
#include <cstdlib> 
#include <cstring> 
#include <ctime> 
#include <cwchar> 
#include <cwctype>

//Containers
#include <array> 
#include <bitset>
#include <deque>
#include <forward_list>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

//Input/Output Stream Library
#include <sstream>
#include <fstream>
#include <iostream>
#include <istream>
#include <ostream>
#include <streambuf>
#include <ios>

//Atomics and threading library
#include <atomic>
#include <condition_variable>
#include <future>
#include <mutex>
#include <thread>

//Miscellaneous headers
#include <algorithm>
#include <chrono>
#include <codecvt>
#include <complex>
#include <exception>
#include <functional>
#include <iterator>
#include <limits>
#include <locale>
#include <memory>
#include <new>
#include <numeric>
#include <random>
#include <ratio>
#include <regex>
#include <stdexcept>
#include <string>
#include <system_error>
#include <tuple>
#include <typeindex>
#include <typeinfo>
#include <type_traits>
#include <utility>
#include <valarray>

NewPDL.hpp(the source of all errors known to man):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//NewPDL.hpp  : Header

//Code Starts Here:

#include "Config.hpp"
#include "Includes.hpp"

NNewPDL::Events O_Events;
NNewPDL::Events::Input O_Input;
NNewPDL::Events::Input::Keyboard O_Keyboard;
//NNewPDL::Screen O_Screen;
//NNewPDL::Networking O_Networking;
//NNewPDL::Threading O_Threading;
//NNewPDL::Sound O_Sound;
//NNewPDL::_3D::Rendering O_3DRendering;
//NNewPDL::_2D::Rendering o_2DRendering;
//NNewPDL::_3D::ADVSOUND O_ADVSound;

//NameSpace that Contains everything NewPDL
namespace NNewPDL
{
	class NewPDL_DLL Events
	{
	public:
		class Input
		{
		public:
			class Keyboard
			{
			
			};
		};
	};
}

and finaly NewPDL.cpp
1
2
3
4
5
//NewPDL.cpp  : The Actual Code

//Code Starts Here:

#include "NewPDL.hpp" 

For your knowledge thats all the code i got and my API is currently only used to stop stuff from, compiling.
Exactly as the error describes:
error C2039: 'Events' : is not a member of 'NNewPDL'

None of these are defined anywhere.
1
2
3
NNewPDL::Events O_Events;
NNewPDL::Events::Input O_Input;
NNewPDL::Events::Input::Keyboard O_Keyboard;


On an unrelated note: Why are you defining Int<size> types, instead of just using int_<size>_t types, since you're already including cstdint in that massive block of unnecessary includes? And why do you have a header including the most (if not all) of the standard library when you use almost none of it?
closed account (z1CpDjzh)
@agent Thanks. You Fixed my problem
Why are you defining Int<size> types, instead of just using int_<size>_t types, since you're already including cstdint in that massive block of unnecessary includes?

int_<size>_t? did not know about those.
 And why do you have a header including the most (if not all) of the standard library when you use almost none of it?

Thats all the standard librarie in VC++... i did that so i dont include somthing twice in my code and get a problem...
No problem!
As for multiple inclusion, it generally won't be an issue (especially with standard library headers). For your own headers, you may want to consider using an include guard: http://en.wikipedia.org/wiki/Include_guard
Topic archived. No new replies allowed.