fork(2) download
  1. #include <iostream>
  2. #include <array>
  3. using namespace std;
  4.  
  5. struct Foo
  6. {
  7. static constexpr double bar = 1.23;
  8. static constexpr std::array<double, 4> acgt_default_background_frequencies = {0.281774, 0.222020, 0.228876, 0.267330};
  9. };
  10.  
  11. int main() {
  12. cout << Foo::bar << endl; // this works
  13. cout << Foo::acgt_default_background_frequencies[0] << endl; // this doesn't work
  14. return 0;
  15. }
Compilation error #stdin compilation error #stdout 0s 3456KB
stdin
Standard input is empty
compilation info
/home/v7WAWh/ccGu0nTn.o: In function `main':
prog.cpp:(.text.startup+0x32): undefined reference to `Foo::acgt_default_background_frequencies'
prog.cpp:(.text.startup+0x38): undefined reference to `Foo::acgt_default_background_frequencies'
collect2: error: ld returned 1 exit status
stdout
Standard output is empty