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!
//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
typedefsignedchar Int8;
typedefunsignedchar Uint8;
// 16 bits integer types
typedefsignedshort Int16;
typedefunsignedshort Uint16;
// 32 bits integer types
typedefsignedint Int32;
typedefunsignedint Uint32;
// 64 bits integer types
#if defined(_MSC_VER)
typedefsigned __int64 Int64;
typedefunsigned __int64 Uint64;
#else
typedefsignedlonglong Int64;
typedefunsignedlonglong Uint64;
#endif
} // namespace NNewPDL
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?
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