KhronosGroup / KhronosGroup/OpenCOLLADA

Build error using clang++ -std=c++11

Open
#560 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
678
Forks
260
PR merge metrics
No merged PRs in 30d

Description

On FreeBSD using clang++ v5.0 with -std=c++11 I am getting a build error -
error: no matching constructor for initialization of 'std::vector<Animation *>'

/usr/bin/c++  -DGENERATEDSAXPARSER_XMLPARSER_LIBXML -DOpenCOLLADAStreamWriter_shared_EXPORTS -DXMLPARSER_LIBXML 
-I/usr/ports/graphics/opencollada/work/OpenCOLLADA-1.6.61/COLLADAStreamWriter/include 
-I/usr/ports/graphics/opencollada/work/OpenCOLLADA-1.6.61/COLLADABaseUtils/include 
-I/usr/ports/graphics/opencollada/work/OpenCOLLADA-1.6.61/COLLADABaseUtils/include/Math 
-I/usr/ports/graphics/opencollada/work/OpenCOLLADA-1.6.61/common/libftoa/include 
-I/usr/ports/graphics/opencollada/work/OpenCOLLADA-1.6.61/common/libBuffer/include 
-I/usr/ports/graphics/opencollada/work/OpenCOLLADA-1.6.61/Externals/UTF/include -O2 -pipe  
-I//usr/local/include -fstack-protector -fno-strict-aliasing  -std=c++11  -O2 -pipe  
-I//usr/local/include -fstack-protector -fno-strict-aliasing  -std=c++11 -fPIC -MD
-MT COLLADAStreamWriter/CMakeFiles/OpenCOLLADAStreamWriter_shared.dir/src/COLLADASWLibraryAnimations.cpp.o
-MF COLLADAStreamWriter/CMakeFiles/OpenCOLLADAStreamWriter_shared.dir/src/COLLADASWLibraryAnimations.cpp.o.d -o 
COLLADAStreamWriter/CMakeFiles/OpenCOLLADAStreamWriter_shared.dir/src/COLLADASWLibraryAnimations.cpp.o -c 
/usr/ports/graphics/opencollada/work/OpenCOLLADA-1.6.61/COLLADAStreamWriter/src/COLLADASWLibraryAnimations.cpp
/usr/ports/graphics/opencollada/work/OpenCOLLADA-1.6.61/COLLADAStreamWriter/src/COLLADASWLibraryAnimations.cpp:65:79: 
error: no matching constructor for initialization of 'std::vector<Animation *>'
            : Library ( streamWriter, CSWC::CSW_ELEMENT_LIBRARY_ANIMATIONS ), mOpenAnimations ( NULL )
                                                                              ^                 ~~~~
 /usr/include/c++/v1/vector:479:40: note: candidate constructor not viable: no known conversion from 'nullptr_t' to 'const std::__1::vector<COLLADASW::Animation *, std::__1::allocator<COLLADASW::Animation *> >::allocator_type' (aka 'const std::__1::allocator<COLLADASW::Animation *>') for 1st argument
    _LIBCPP_INLINE_VISIBILITY explicit vector(const allocator_type& __a)
                                       ^
/usr/include/c++/v1/vector:491:14: note: candidate constructor not viable: no known conversion from 'nullptr_t' to 'std::__1::vector<COLLADASW::Animation *, std::__1::allocator<COLLADASW::Animation *> >::size_type' (aka 'unsigned long') for 1st argument
    explicit vector(size_type __n);
             ^
/usr/include/c++/v1/vector:534:5: note: candidate constructor not viable: no known conversion from 'nullptr_t' to 'const std::__1::vector<COLLADASW::Animation *, std::__1::allocator<COLLADASW::Animation *> >' for 1st argument
    vector(const vector& __x);
    ^
/usr/include/c++/v1/vector:541:5: note: candidate constructor not viable: no known conversion from 'nullptr_t' to 'initializer_list<std::__1::vector<COLLADASW::Animation *, std::__1::allocator<COLLADASW::Animation *> >::value_type>' (aka 'initializer_list<COLLADASW::Animation *>') for 1st argument
    vector(initializer_list<value_type> __il);
    ^
/usr/include/c++/v1/vector:547:5: note: candidate constructor not viable: no known conversion from 'nullptr_t' to 'std::__1::vector<COLLADASW::Animation *, std::__1::allocator<COLLADASW::Animation *> >' for 1st argument
    vector(vector&& __x)
    ^

I am actually test building with pre-releases of clang v6.0 which has defaults set to using -std=c++14 but I'm getting the same error with clang 5.0 using -std=c++11 and -std=c++0x

Changing NULL to 0 compiles, but is mOpenAnimations ( 0 ) a reasonable change? or is there a better option.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at COLLADAStreamWriter/src/COLLADASWLibraryAnimations.cpp around line 65 and inspect the mOpenAnimations initializer. Reproduce the reported FreeBSD clang++ C++11 build, then verify the selected change builds successfully without introducing errors under the reported standards.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, compilers
Issue type
Bug
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.