Skip to content

problem on compiling in linux GCC 4.8 #1

@chinlin0924

Description

@chinlin0924

Hi,

I think gcc 4.8 has C++ feature, but it still have problem in your code.
Any idea?
thank you

g++ -o test_usb src/libtest.cpp src/openaccessory.cpp -std=c++11 -Wall
pkg-config --libs --cflags libusb-1.0
In file included from src/libtest.cpp:19:0:
src/openaccessory.hpp:53:73: error: ‘constexpr’ needed for in-class initialization of static data member ‘const std::array<unsigned int, 4ul> OpenAccessory::_pid’ of non-integral type [-fpermissive]
In file included from src/openaccessory.cpp:18:0:
src/openaccessory.hpp:53:73: error: ‘constexpr’ needed for in-class initialization of static data member ‘const std::array<unsigned int, 4ul> OpenAccessory::_pid’ of non-integral type [-fpermissive]
src/openaccessory.cpp:209:36: error: duplicate initialization of ‘OpenAccessory::_pid’
src/openaccessory.cpp:209:36: error: conflicting declaration ‘const uint32_t OpenAccessory::_pid []’
In file included from src/openaccessory.cpp:18:0:
src/openaccessory.hpp:53:73: error: ‘OpenAccessory::_pid’ has a previous declaration as ‘const std::array<unsigned int, 4ul> OpenAccessory::_pid’
src/openaccessory.cpp:209:36: error: declaration of ‘const std::array<unsigned int, 4ul> OpenAccessory::_pid’ outside of class is not definition [-fpermissive]
src/openaccessory.cpp:209:71: error: ‘constexpr’ needed for in-class initialization of static data member ‘const std::array<unsigned int, 4ul> OpenAccessory::_pid’ of non-integral type [-fpermissive]
make: *** [test] Error 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions