Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Undefined Type 'uint32_t' by Including <cstdint> #148

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

citb0in
Copy link

@citb0in citb0in commented Dec 19, 2024

The following error occurs when trying to compile. It has been reported by many users:

$ make

cd obj &&       mkdir -p GPU
cd obj &&       mkdir -p hash
g++ -m64 -mssse3 -Wno-write-strings -O2 -I. -I/usr/local/cuda-8.0/include -o obj/main.o -c main.cpp
In file included from main.cpp:18:
Timer.h:36:10: error: ‘uint32_t’ does not name a type
   36 |   static uint32_t getSeed32();
      |          ^~~~~~~~
Timer.h:23:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   22 | #include <string>
  +++ |+#include <cstdint>
   23 | #ifdef WIN64
Timer.h:37:27: error: ‘uint32_t’ has not been declared
   37 |   static void SleepMillis(uint32_t millis);
      |                           ^~~~~~~~
main.cpp: In function ‘int main(int, char**)’:
main.cpp:372:16: error: ‘getSeed32’ is not a member of ‘Timer’
  372 |   rseed(Timer::getSeed32());
      |                ^~~~~~~~~

This happens because the type uint32_t is used, but the corresponding definition is missing. uint32_t is one of the standardized data types defined in .
If this header file is not included, the compiler does not recognize the type and issues the error. This type is defined in the header file . The compiler already suggests including the header file.

This patch will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant