sweenal / opencollada

Automatically exported from code.google.com/p/opencollada
0 stars 0 forks source link

error compiling on ubuntu linux ('COLLADABU_ASSERT' was not declared in this scope) #156

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
scons: *** [dae2ogre/obj/posix/x86_64/debuglibxml/src/DAE2OgreMeshWriter.o] 
Error 1
In file included from COLLADAFramework/include/COLLADAFWArrayPrimitiveType.h:15,
                 from COLLADAFramework/include/COLLADAFWTypes.h:15,
                 from COLLADAFramework/include/COLLADAFWUniqueId.h:15,
                 from dae2ogre/include/DAE2OgreOgreWriter.h:17,
                 from dae2ogre/include/DAE2OgreBaseWriter.h:15,
                 from dae2ogre/src/DAE2OgreBaseWriter.cpp:12:
COLLADAFramework/include/COLLADAFWArray.h: In member function 'Type& 
COLLADAFW::Array<Type>::operator[](size_t) [with Type = 
COLLADAFW::TextureCoordinateBinding]':
COLLADAFramework/include/COLLADAFWArray.h:179:   instantiated from 'void 
COLLADAFW::Array<Type>::cloneArray(COLLADAFW::Array<Type>&) const [with Type = 
COLLADAFW::TextureCoordinateBinding]'
COLLADAFramework/include/COLLADAFWMaterialBinding.h:81:   instantiated from here
COLLADAFramework/include/COLLADAFWArray.h:161: error: 'COLLADABU_ASSERT' was 
not declared in this scope
COLLADAFramework/include/COLLADAFWArray.h: In member function 'Type& 
COLLADAFW::Array<Type>::operator[](size_t) [with Type = 
COLLADAFW::MaterialBinding]':
COLLADAFramework/include/COLLADAFWArray.h:179:   instantiated from 'void 
COLLADAFW::Array<Type>::cloneArray(COLLADAFW::Array<Type>&) const [with Type = 
COLLADAFW::MaterialBinding]'
COLLADAFramework/include/COLLADAFWInstanceBindingBase.h:60:   instantiated from 
'COLLADAFW::InstanceBindingBase<classId>::InstanceBindingBase(const 
COLLADAFW::InstanceBindingBase<classId>&) [with 
COLLADAFW::COLLADA_TYPE::ClassId classId = 
(COLLADAFW::COLLADA_TYPE::ClassId)437u]'
COLLADAFramework/include/COLLADAFWInstanceBindingBase.h:45:   instantiated from 
'COLLADAFW::InstanceBindingBase<classId>* 
COLLADAFW::InstanceBindingBase<classId>::clone() const [with 
COLLADAFW::COLLADA_TYPE::ClassId classId = 
(COLLADAFW::COLLADA_TYPE::ClassId)437u]'
COLLADAFramework/include/COLLADAFWPointerArray.h:86:   instantiated from 'void 
COLLADAFW::PointerArray<T>::cloneContents(const COLLADAFW::PointerArray<T>&) 
[with T = 
COLLADAFW::InstanceBindingBase<(COLLADAFW::COLLADA_TYPE::ClassId)437u>]'
COLLADAFramework/include/COLLADAFWPointerArray.h:50:   instantiated from 
'COLLADAFW::PointerArray<T>::PointerArray(const COLLADAFW::PointerArray<T>&) 
[with T = 
COLLADAFW::InstanceBindingBase<(COLLADAFW::COLLADA_TYPE::ClassId)437u>]'
COLLADAFramework/include/COLLADAFWNode.h:46:   instantiated from here
COLLADAFramework/include/COLLADAFWArray.h:161: error: 'COLLADABU_ASSERT' was 
not declared in this scope
scons: *** [dae2ogre/obj/posix/x86_64/debuglibxml/src/DAE2OgreBaseWriter.o] 
Error 1
scons: building terminated because of errors.

opencollada svn r833 on Ubuntu Lucid 10.04 AMD64
gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) 

Original issue reported on code.google.com by hva.fran...@gmail.com on 3 Feb 2011 at 8:58

GoogleCodeExporter commented 8 years ago
I believe the recent change from simply using assert to using COLLADABU_ASSERT 
wasn;t reflected in one particular file. I have attached the patch here.

Index: COLLADAFramework/include/COLLADAFWArray.h
===================================================================
--- COLLADAFramework/include/COLLADAFWArray.h   (revision 833)
+++ COLLADAFramework/include/COLLADAFWArray.h   (working copy)
@@ -12,6 +12,7 @@
 #define __COLLADAFW_ARRAY_H__

 #include "COLLADAFWPrerequisites.h"
+#include "COLLADABUPlatform.h"
 #include <cassert>

Original comment by freaka...@gmail.com on 12 Feb 2011 at 10:10

GoogleCodeExporter commented 8 years ago
I have similar issue in revision 839.

here is the error

In file included from 
/home/alexey/workspace/opencollada/common/libBuffer/src/CommonCharacterBuffer.cp
p:11:0:
/home/alexey/workspace/opencollada/common/libBuffer/include/CommonCharacterBuffe
r.h: In member function ‘bool 
Common::CharacterBuffer::copyToBufferAsChar(IntegerType)’:
/home/alexey/workspace/opencollada/common/libBuffer/include/CommonCharacterBuffe
r.h:97:55: error: there are no arguments to ‘COLLADABU_ASSERT’ that depend 
on a template parameter, so a declaration of ‘COLLADABU_ASSERT’ must be 
available
/home/alexey/workspace/opencollada/common/libBuffer/include/CommonCharacterBuffe
r.h:97:55: note: (if you use ‘-fpermissive’, G++ will accept your code, but 
allowing the use of an undeclared name is deprecated)
make[2]: *** 
[common/libBuffer/CMakeFiles/buffer_shared.dir/src/CommonCharacterBuffer.cpp.o] 
Error 1
make[1]: *** [common/libBuffer/CMakeFiles/buffer_shared.dir/all] Error 2
make: *** [all] Error 2

Original comment by Alexey.Z...@gmail.com on 17 May 2011 at 10:08

GoogleCodeExporter commented 8 years ago
the problem is in the libBuffer in CommonCharacterBuffer.h

Here is the problem part:

bool CharacterBuffer::copyToBufferAsChar( IntegerType i)
    {
        size_t maxIntLength = Itoa<IntegerType>::MINIMUM_BUFFERSIZE_10;

        if ( getBytesAvailable() < maxIntLength )
        {
            //The int might not fit into the buffer. We need to flush first.
            flushBuffer();
        }

        // Check if the buffer size is large enough
        COLLADABU_ASSERT(getBytesAvailable() >= maxIntLength);
        if ( getBytesAvailable() < maxIntLength )
        {
            //No chance to convert the double with this buffer
            return false;
        }

        increaseCurrentPosition( itoa( i, getCurrentPosition(), 10) );

        return true;
    }

Correct me if I am wrong, COLLADABU_ASSERT shouldn't be in libBuffer. Since 
libBuffer is independent from ColladaBaseUtils.

My solution is to comment this line out.

Original comment by Alexey.Z...@gmail.com on 17 May 2011 at 11:57