It is currently Sat Aug 22, 2020 4:30 am


All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: PolyVox Multiple Defined Symbols Problem
PostPosted: Thu Mar 17, 2011 6:10 am 
User avatar

Joined: Tue Feb 22, 2011 8:04 am
Posts: 101
I am having problems with linker errors when compiling my polyvox project.
The linker complains of multiple defined symbols no matter how isolated I
make the polyvox includes.
For some reason even when I put them into my precompiled header file
they are apparently being included more than once.

I get five errors that all look about like this.

Error 52 error LNK2005: "private: void __thiscall PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::fillInitialVertexMetadata(class std::vector<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::InitialVertexMetadata,class std::allocator<struct PolyVox::MeshDecimator<class PolyVox::PositionMaterial>::InitialVertexMetadata> > &)" (?fillInitialVertexMetadata@?$MeshDecimator@VPositionMaterial@PolyVox@@@...
...PolyVox@@AAEXAAV?$vector@UInitialVertexMetadata@?$MeshDecimator@...
...VPositionMaterial@PolyVox@@@PolyVox@@V?$allocator@UInitialVertexMetadata@...
...?$MeshDecimator@VPositionMaterial@PolyVox@@@PolyVox@@@std@@@std@@@Z) already defined in WorldCraft.obj C:\Users\Devin Nelson\Documents\Visual Studio 2010\Projects\WorldCraft\WorldCraft\WorldManager.obj WorldCraft

They are all related to the MeshDecimator class.
I can't figure out what I am doing wrong.
It must be related to some error in my includes, but I can't find any duplicate includes anywhere.

Here are the only polyvox includes being used that I am aware of.
// Polyvox includes
#include "Filters.h"
#include "Log.h"
#include "MaterialDensityPair.h"
#include "Volume.h"
#include "SurfaceMesh.h"
#include "MeshDecimator.h"
#include "PolyVoxImpl/Utility.h"
#include "VertexTypes.h"
#include "SurfaceExtractor.h"

I appreciate the help I have been given so far. Thanks

_________________
--Real Programmers use a magnetized needle and a steady hand.
--xkcd--


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Multiple Defined Symbols Problem
PostPosted: Thu Mar 17, 2011 12:54 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Ok, I can't say for sure as I will need more time to do some testing, but there is a chance this is a problem in PolyVox. In particular, the function you list (fillInitialVertexMetadata()) has two complete implementations, one for PositionMaterial and one for PositionMaterialNormal. Because these implementations do not take any template parameters it may be incorrect for them to be in the .inl file. They may need to be in a .cpp file instead.

I'm not certain how these need to be arranged, I will try to look at it tonight but probably won't manage until tomorrow.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Multiple Defined Symbols Problem
PostPosted: Fri Mar 18, 2011 3:17 am 

Joined: Sun Jan 23, 2011 6:06 am
Posts: 92
I have noticed the same problem. For me it was with MeshDecimator.h

I found that the only way to compile my project was to include it in a single .cpp file only. If I included MeshDecimator.h anywhere else in my project, especially in any .h file, I would get the 'already defined' compiler error.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Multiple Defined Symbols Problem
PostPosted: Fri Mar 18, 2011 5:48 pm 
User avatar

Joined: Tue Feb 22, 2011 8:04 am
Posts: 101
Yes that is the same for me. MeshDecimator.h is the problem.
I can work around for now by including it in one cpp file only, but it would be nice to include it in my header file.

I wonder if there is any easy edits I could make to the library to fix this?

_________________
--Real Programmers use a magnetized needle and a steady hand.
--xkcd--


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Multiple Defined Symbols Problem
PostPosted: Fri Mar 18, 2011 10:06 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Ok, I think I've fixed this in the trunk, so let me know if it works. If you are on the RLE branch you'll have to wait until it gets merged in to the trunk. Or if you are feeling brave you can bring the patch across yourself (it's revision 1421).


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Multiple Defined Symbols Problem
PostPosted: Tue Mar 22, 2011 5:20 pm 
User avatar

Joined: Tue Feb 22, 2011 8:04 am
Posts: 101
Sorry for the delay, school has been busy lately.

Yes the changes worked. I can now include MeshDecimator.h in my precompiled header file.

Thank you for the fix and help!

_________________
--Real Programmers use a magnetized needle and a steady hand.
--xkcd--


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net