Hi,
I have searched Google on the .dll subject and i got a few tutorials which helped allot but i feel that its not enough information to get me going.
Do you know where i can find great articles or even books(even if the .dll topic is only present in only 1 chapter) on the .dll creation topic?
Thanks in advanced.
Where can i get a brief info on creating .Dll's
-
Lil Margin
- Posts: 212
- Joined: Sun Jul 19, 2009 4:24 am
- Location: Netherlands Antilles, Curacao
-
Lil Margin
- Posts: 212
- Joined: Sun Jul 19, 2009 4:24 am
- Location: Netherlands Antilles, Curacao
I tried that but i start to get errors and i dont know why(mainly becaise i lack info)
i am getting a list of errors :
Engine.h :
Engine.cpp
I dont know why i am getting this error and Googling did not get me very far either...
Do you know why i am getting this error?
[edit]Yes, everything is proper linked...
i am getting a list of errors :
as i have seen in other example you dont export everything in a class but only the class itself so i did thesame thing :error C2143: syntax error : missing ';' before '*'
: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
: error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>.\Engine.cpp(5) : warning C4273: 'Engine::InitEngine' : inconsistent dll linkage
1> c:\work\engines\tradur\tradur\Engine.h(24) : see previous definition of 'InitEngine'
1>.\Engine.cpp(9) : error C2065: 'guienv' : undeclared identifier
1>.\Engine.cpp(13) : warning C4273: 'Engine::CloseEngine' : inconsistent dll linkage
1> c:\work\engines\tradur\tradur\Engine.h(25) : see previous definition of 'CloseEngine'
1>.\Engine.cpp(18) : warning C4273: 'Engine::returnDevice' : inconsistent dll linkage
1> c:\work\engines\tradur\tradur\Engine.h(28) : see previous definition of 'returnDevice'
1>.\Engine.cpp(23) : warning C4273: 'Engine::UpdateEngine' : inconsistent dll linkage
1> c:\work\engines\tradur\tradur\Engine.h(27) : see previous definition of 'UpdateEngine'
1>.\Engine.cpp(26) : error C2065: 'guienv' : undeclared identifier
1>.\Engine.cpp(26) : error C2227: left of '->drawAll' must point to class/struct/union/generic type
1> type is ''unknown-type''
1>.\Engine.cpp(31) : warning C4273: 'Engine::WindowSetCaption' : inconsistent dll linkage
Engine.h :
Code: Select all
#ifndef _DLL_ENGINE_H_
#define _DLL_ENGINE_H_
#if defined DLL_EXPORT
#define DECLDIR __declspec(dllexport)
#else
#define DECLDIR __declspec(dllimport)
#endif
#include <irrlicht.h>
using namespace irr; //namespace for the graphics engine, makes it easier to read
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
extern "C"
{
class DECLDIR Engine
{
public:
void InitEngine(int x, int y, bool fullscreen); //starting the engine up
void CloseEngine(); //shut the engine down
void WindowSetCaption(const wchar_t* caption); //change the caption
void UpdateEngine();
IrrlichtDevice* returnDevice();
private:
IrrlichtDevice* mydevice;
IVideoDriver* driver;
ISceneManager* smgr;
IGUIEnvironment* guienv;
};
}
#endifCode: Select all
#include "Engine.h"
#define DLL_EXPORT
void Engine::InitEngine(int x, int y, bool fullscreen)
{
mydevice = createDevice(video::EDT_OPENGL, dimension2d<u32>(x, y), 16, fullscreen, false, false, 0);
driver = mydevice->getVideoDriver();
smgr = mydevice->getSceneManager();
guienv = mydevice->getGUIEnvironment();
}
void Engine::CloseEngine()
{
mydevice->drop();
}
IrrlichtDevice *Engine::returnDevice()
{
return mydevice;
}
void Engine::UpdateEngine()
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
void Engine::WindowSetCaption(const wchar_t* caption)
{
mydevice->setWindowCaption(caption);
}I dont know why i am getting this error and Googling did not get me very far either...
Do you know why i am getting this error?
[edit]Yes, everything is proper linked...
