jianyangqt / gcta

GCTA software
GNU General Public License v3.0
73 stars 23 forks source link

Fix build with gcc-13 #42

Open HippocampusGirl opened 1 year ago

HippocampusGirl commented 1 year ago

The new compiler version GCC 13 requires explicitly including the header <cstdint> to be able to use types such as uint8_t, etc. (see here). Before, these types were available by default when including <string>.

As the code for GCTA was written before this change, building with the new compiler version leads to multiple errors such as

In file included from /work/charite/src/gcta/src/utils.cpp:18:
/work/charite/src/gcta/include/utils.hpp:42:1: error: 'uint64_t' does not name a type
   42 | uint64_t getFileByteSize(FILE * file);
      | ^~~~~~~~
/work/charite/src/gcta/include/utils.hpp:34:1: note: 'uint64_t' is defined in header '<cstdint>'; did you forget to '#include <cstdint>'?
   33 | #include <sstream>
  +++ |+#include <cstdint>
   34 |

This pull request fixes these errors by including the <cstdint> header where it is needed.