PrdglSqrl
31-01-2008 22:50:02
I'll get right to it. Here are linker errors:
This is what happens when I attempt to link against your library. I recently updated my version of Ogre from 1.4.5 to 1.4.6. I recompiled your addon and even tested the examples. They worked flawlessly. However, every time I attempt you use them in my own application, where I have copied the library files into my projects library directory, I recieve the above linker problems.
The first is especially weird, the way I interpret is as though I have redefined the deconstructor for your GrassPage class. Nowhere in my code do I do any such thing.
Now, the way I'm using the library is by wrapping the core functionality of it into classes I call Seeders. Here's the layout for my BillBoardSeeder class:
The only place I use a GrassPage is in init(), which looks like this:
I can't see anything wrong with that, especially considering it all worked before I switched to the new version of Ogre. And since I made sure to recompile your library under the new version, and copy the .lib files, I can't think of what I've done wrong.
What do you think?
1>PagedGeometry_d.lib(GrassLoader.obj) : error LNK2005: "public: virtual __thiscall GrassPage::~GrassPage(void)" (??1GrassPage@@UAE@XZ) already defined in Seeder.obj
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Seeder.obj : error LNK2019: unresolved external symbol "public: void __thiscall TreeLoader2D::addTree(class Ogre::Entity *,class Ogre::Vector2 const &,class Ogre::Degree,float)" (?addTree@TreeLoader2D@@QAEXPAVEntity@Ogre@@ABVVector2@3@VDegree@3@M@Z) referenced in function "public: void __thiscall MeshSeeder::addSeed(class Ogre::Entity *,float,float)" (?addSeed@MeshSeeder@@QAEXPAVEntity@Ogre@@MM@Z)
1>Seeder.obj : error LNK2019: unresolved external symbol "public: void __thiscall GrassLoader::updateAnimation(void)" (?updateAnimation@GrassLoader@@QAEXXZ) referenced in function "public: void __thiscall BillboardSeeder::update(void)" (?update@BillboardSeeder@@QAEXXZ)
This is what happens when I attempt to link against your library. I recently updated my version of Ogre from 1.4.5 to 1.4.6. I recompiled your addon and even tested the examples. They worked flawlessly. However, every time I attempt you use them in my own application, where I have copied the library files into my projects library directory, I recieve the above linker problems.
The first is especially weird, the way I interpret is as though I have redefined the deconstructor for your GrassPage class. Nowhere in my code do I do any such thing.
Now, the way I'm using the library is by wrapping the core functionality of it into classes I call Seeders. Here's the layout for my BillBoardSeeder class:
class BillboardSeeder{
private:
PagedGeometry* seeder;
GrassLoader* loader;
vector<bool> animated;
map<string, GrassLayer*> layers;
public:
BillboardSeeder();
BillboardSeeder(YEI3D* app, float pageSize, float cullDist);
~BillboardSeeder();
void init(YEI3D* app, float pageSize, float cullDist);
void destroy();
void update();
void reload();
GrassLayer* addLayer(string name, string mname);
GrassLayer* addLayer(string name, string mname, float minw, float minh, float maxw, float maxh, float density, FadeTechnique fadeTech, bool animated=true, float swaydist=1.0, float swaylen=1.0, float swayspd=1.0);
bool configureLayer(string name, float minw, float minh, float maxw, float maxh, float density, FadeTechnique fadeTech, bool animated=true, float swaydist=1.0, float swaylen=1.0, float swayspd=1.0);
void configureLayer(GrassLayer* layer, float minw, float minh, float maxw, float maxh, float density, FadeTechnique fadeTech, bool animated=true, float swaydist=1.0, float swaylen=1.0, float swayspd=1.0);
void setDensityMap(string name, string fname, TBounds bounds);
void setAnimated(string name, bool b);
void setHeightFunction(Real (*heightFunc)(Real, Real)){ loader->setHeightFunction(heightFunc); }
map<string, GrassLayer*> getLayers(){ return layers; }
};
The only place I use a GrassPage is in init(), which looks like this:
void BillboardSeeder::init(YEI3D* app, float pageSize, float cullDist){
seeder = new PagedGeometry(app->getCamera(), pageSize);
seeder->addDetailLevel<GrassPage>(cullDist);
loader = new GrassLoader(seeder);
seeder->setPageLoader(loader);
}
I can't see anything wrong with that, especially considering it all worked before I switched to the new version of Ogre. And since I made sure to recompile your library under the new version, and copy the .lib files, I can't think of what I've done wrong.
What do you think?