android_open_accessory_lib icon indicating copy to clipboard operation
android_open_accessory_lib copied to clipboard

problem on compiling in linux GCC 4.8

Open chinlin0924 opened this issue 9 years ago • 0 comments

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

chinlin0924 avatar Oct 19 '16 07:10 chinlin0924