|
It's not a linker problem. The compiler is complaining about not finding .h files
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
manju23reddy wrote: how to set the project properties so that i can link the files form my sdk folder...
What version of VS are you using? With VS2005, click Options from the Tools menu. Open Projects and Solutions, and select VC++ Directories.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Suppose I declare a static variable in a dll, and simultaneously launch two applications which use the same dll. Now if I change the value of that static variable from one application, will the other application will be affected by this?
Specifically, will Singletons will behave properly if I declare them in a dll?
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
The NULL Developer wrote: Now if I change the value of that static variable from one application, will the other application will be affected by this?
No, because when a DLL is loaded by a process, it is loaded into the address space of the calling process, creating a copy of the module, which means the data in the DLL used by one process will be separated from the data in the DLL used by the other process.
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|
|
Thanks Perspx, exactly what I had expected.
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
Be carefull with doing that. I remember a problem I had some years ago which consisted also of a singleton in a dll (using static variable). This didn't work because the dll (from which the singleton was coming) had a different instance of the static variable than the exe. Which means that if you have to use the singleton in the exe and in the dll, you will end-up with two copies of the singleton.
|
|
|
|
|
Hi Cedric, can you explain a little bit more about the problem, what was the cause, and how it was resolved? I am sure it will help me to keep your caution in mind while designing in future.
"Do first things first, and second things not at all."
— Peter Drucker.
|
|
|
|
|
After searching for a while, I found back a question I asked on codeguru: see here[^]. I didn't go into too much details though.
|
|
|
|
|
Hi!
My project is compiling fine. But it shows linker errrors.
testAI.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: float __thiscall osgGA::GUIEventAdapter::getYmax(void)const " (__imp_?getYmax@GUIEventAdapter@osgGA@@QBEMXZ)
testAI.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: float __thiscall osgGA::GUIEventAdapter::getYmin(void)const " (__imp_?getYmin@GUIEventAdapter@osgGA@@QBEMXZ)
D:\GUI04072008\Release\GUI.exe : fatal error LNK1120: 2 unresolved externals
I've included all the libraries. What to do?
|
|
|
|
|
did u make an entry in the .def file of the dll?
|
|
|
|
|
I don't know about def file. Where it is located?
|
|
|
|
|
looks like u r using n dll right?
then in the solution explorer u will find n .def file in the source files section.
open it and make an entry of ur function name which u want to export.
|
|
|
|
|
if it still doesnt work then try putting the foll:
?getYmax@GUIEventAdapter@osgGA@@QBEMXZ
(which i took from ur post itself)
Prasann
enjoy
|
|
|
|
|
There's no .def file in my solution. Only source and header files are there.
|
|
|
|
|
Are you sure you link with the lib file that is provided with the dll ?
|
|
|
|
|
|
Are you sure your class is exported in the dll ? Can you post the code of the header file for this class ?
Did you also provide a body for those functions ?
|
|
|
|
|
Here it is:
#ifndef DELTA_TestAI
#define DELTA_TestAI
#include <string>
#include <dtCore/refptr.h>
#include <dtABC/application.h>
#include <dtCore/camera.h>
#include "aicharacter.h"
#include <dtCore/collisionmotionmodel.h>
#include <osg/Matrix>
namespace dtCore
{
class Object;
class Transform;
class CollisionMotionModel;
}
namespace dtChar
{
class Character;
}
namespace dtDAL
{
class Project;
}
using namespace dtCore;
using namespace dtChar;
using namespace dtDAL;
class TestAI : public dtABC::Application
{
public:
TestAI(const std::string& mapName = "vismap6", const std::string& configFilename = "config.xml");
protected:
~TestAI();
public:
virtual void Config();
virtual bool KeyPressed(const dtCore::Keyboard* keyboard, int key);
virtual void PreFrame( const double deltaFrameTime );
private:
void LoadDemoMap(const std::string& pStr);
float mSpeed;
bool mDrawNavMesh;
bool char7start;
unsigned int pWaypointNum[7];
unsigned pAISpeed[7];
unsigned pStopWaypoint[7];
std::string mMapFilename;
dtCore::RefPtr<dtCore::Camera> mOverheadCamera;
dtCore::RefPtr<dtAI::AICharacter> mCharacter1;
dtCore::RefPtr<dtAI::AICharacter> mCharacter2;
dtCore::RefPtr<dtAI::AICharacter> mCharacter3;
dtCore::RefPtr<dtAI::AICharacter> mCharacter4;
dtCore::RefPtr<dtAI::AICharacter> mCharacter5;
dtCore::RefPtr<dtAI::AICharacter> mCharacter6;
dtCore::RefPtr<dtAI::AICharacter> mCharacter7;
dtCore::RefPtr<dtCore::Object> m_Obj;
osg::Matrix mCameraOffset;
dtCore::RefPtr<CollisionMotionModel> mMotionModels;
protected:
osg::ref_ptr<osg::Node> _node;
float _velocity;
osg::Vec3 _eye;
osg::Quat _rotation;
osg::ref_ptr<const osgGA::GUIEventAdapter> _ga_t1;
osg::ref_ptr<const osgGA::GUIEventAdapter> _ga_t0;
float _distance;
void computePosition(const osg::Vec3& eye,const osg::Vec3& lv,const osg::Vec3& up);
void flushMouseEventStack();
};
#endif // DELTA_TestAI
Yes. I defined all the declared functions.
|
|
|
|
|
No, I was talking about the osgGA::GUIEventAdapter class, the one from the dll. Did you write this dll ? If not, from where is it coming from ?
|
|
|
|
|
How to created a well-formatted xml document like this using MSXML(I'm using MSXML6)?
<?xml version="1.0" encoding="utf-8"?>
<!--there are some comments-->
<root>
<node1>...</node1>
</root>
I found no way to add a CRLF after the ProcessInstruction and the first comment, but I do know how to add a CRLF in root node——Just createTextNode and add to the root element.
So my program will always create a xml document like this
<?xml version="1.0" encoding="utf-8"?><!--there are some comments--><root>
<node1>...</node1>
</root>
Please help. Thanks
A Chinese VC++ programmer
|
|
|
|
|
|
Hi all
I have a MDI Application and i am Adding a resource type new Dailog. And in this dailog i have taken a List Box.In this dailog i am calling in .cpp file of MDI.It is working in proper way.
Currently out is showing on MDI Application.But I want to show Out put on listbox. Plz help me
|
|
|
|
|
Hello !
I have declared an byte array say,
BYTE abyData [256];
since i donot know how much memory is exactly necessary.
now in a function i used only 20 bytes of memory i.e
abyData [0] = 23
abyData [1] = 21
.
.
abyData [19] = 45
Now I want to free/release rest of the memory from 20 - 255 ?
|
|
|
|
|
kapardhi wrote: BYTE abyData [256];
You cant do that..
You can use new/delete Or malloc/free for allocating the memory you need.
Regards,
Sandip.
|
|
|
|
|
Allocate 20 bytes of memory then copy the data you need to this new BYTE array then free delete the old one.
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
Introduction to Object-Oriented JavaScript
|
|
|
|