I'm getting these 2 errors:
14 K:\game\dll\level1\Level1.cpp `Enemy' is not a type
14 K:\game\dll\level1\Level1.cpp request for member of non-aggregate type before '.' token
and warnings from this code
I'm new to dlls and vectors and have no idea what i'm doing
what's wrong with my code and what's line 7 to 11 in Level.h do?
Level1.cpp
Code:
#include "Level1.h"
#include <windows.h>
#include "..\..\source\enemy.h"
extern std::vector<C_Level*> Level;
extern std::vector<C_Enemy*> Enemy;
__declspec(dllexport) void Level1()
{
Level.push_back(new C_Level);
POINT P[] = {{0,0},{1,1},{2,2},{3,3},{5,5},{7,7},{12,12},{19,19},{20,20},{24,23}, {NULL, NULL}};
Level[0].Enemy.push_back(new C_Enemy("enemy1", 10000, P)); //ERROR HERE
}
BOOL APIENTRY DllMain (HINSTANCE hInst /* Library instance handle. */ ,
DWORD reason /* Reason this function is being called. */ ,
LPVOID reserved /* Not used. */ )
{
switch (reason)
{
case DLL_PROCESS_ATTACH:
break;
case DLL_PROCESS_DETACH:
break;
case DLL_THREAD_ATTACH:
break;
case DLL_THREAD_DETACH:
break;
}
/* Returns TRUE on success, FALSE on failure */
return TRUE;
}
Level1.h
Code:
#ifndef LEVEL1_H_INCLUDED
#define LEVEL1_H_INCLUDED
#include <vector>
#include <windows.h>
#if BUILDING_DLL
# define DLLIMPORT __declspec (dllexport)
#else /* Not BUILDING_DLL */
# define DLLIMPORT __declspec (dllimport)
#endif /* Not BUILDING_DLL */
__declspec(dllexport) void Level1();
#endif
thanks in advance