nurupo / ProjectTox-Qt-GUI

A cross-platform front end for ProjectTox Core library, written in C++11 with use of Qt5
GNU General Public License v3.0
341 stars 116 forks source link

Compile error: ‘uint****’ has not been declared / does not name a type #9

Closed cidious closed 11 years ago

cidious commented 11 years ago

Hello, just faced an error while compiling using build instructions:

...
warnings warnings
...

../src/core.hpp:34:33: error: ‘uint8_t’ has not been declared
     static void onFriendRequest(uint8_t* cUserId, uint8_t* cMessage, uint16_t cMessageSize);
                                 ^
../src/core.hpp:34:51: error: ‘uint8_t’ has not been declared
     static void onFriendRequest(uint8_t* cUserId, uint8_t* cMessage, uint16_t cMessageSize);
                                                   ^
../src/core.hpp:34:70: error: ‘uint16_t’ has not been declared
     static void onFriendRequest(uint8_t* cUserId, uint8_t* cMessage, uint16_t cMessageSize);
                                                                      ^
../src/core.hpp:35:47: error: ‘uint8_t’ has not been declared
     static void onFriendMessage(int friendId, uint8_t* cMessage, uint16_t cMessageSize);
                                               ^
../src/core.hpp:35:66: error: ‘uint16_t’ has not been declared
     static void onFriendMessage(int friendId, uint8_t* cMessage, uint16_t cMessageSize);
                                                                  ^
../src/core.hpp:36:50: error: ‘uint8_t’ has not been declared
     static void onFriendNameChange(int friendId, uint8_t* cName, uint16_t cNameSize);
                                                  ^
../src/core.hpp:36:66: error: ‘uint16_t’ has not been declared
     static void onFriendNameChange(int friendId, uint8_t* cName, uint16_t cNameSize);
                                                                  ^
../src/core.hpp:51:9: error: ‘uint8_t’ does not name a type
         uint8_t* data();
         ^
../src/core.hpp:52:9: error: ‘uint16_t’ does not name a type
         uint16_t size();
         ^
../src/core.hpp:54:33: error: ‘uint8_t’ has not been declared
         static QString toString(uint8_t* cUserId/*, uint16_t cUserIdSize*/);
                                 ^
../src/core.hpp:57:9: error: ‘uint8_t’ does not name a type
         uint8_t* cUserId;
         ^
../src/core.hpp:58:9: error: ‘uint16_t’ does not name a type
         uint16_t cUserIdSize;
         ^
../src/core.hpp:60:16: error: ‘uint16_t’ does not name a type
         static uint16_t fromString(const QString& userId, uint8_t* cUserId);
                ^
../src/core.hpp:69:9: error: ‘uint8_t’ does not name a type
         uint8_t* data();
         ^
../src/core.hpp:70:9: error: ‘uint16_t’ does not name a type
         uint16_t size();
         ^
../src/core.hpp:72:33: error: ‘uint8_t’ has not been declared
         static QString toString(uint8_t* cMessage, uint16_t cMessageSize);
                                 ^
../src/core.hpp:72:52: error: ‘uint16_t’ has not been declared
         static QString toString(uint8_t* cMessage, uint16_t cMessageSize);
                                                    ^
../src/core.hpp:73:33: error: ‘uint8_t’ has not been declared
         static QString toString(uint8_t* cMessage);
                                 ^
../src/core.hpp:79:9: error: ‘uint8_t’ does not name a type
         uint8_t* cString;
         ^
../src/core.hpp:80:9: error: ‘uint16_t’ does not name a type
         uint16_t cStringSize;
         ^
../src/core.hpp:82:16: error: ‘uint16_t’ does not name a type
         static uint16_t fromString(const QString& message, uint8_t* cMessage);
                ^
nurupo commented 11 years ago

Try adding #include <stdint.h> at the top of core.hpp and tell if that fixes it.

Spittie commented 11 years ago

You're probably compiling that with Qt4 (I got the same errors when I tried). You need to use Qt5 (in my case, I had to replace qmake with qmake-qt5).

cidious commented 11 years ago

yeah, you're right, I'm using the QT4 and #include doesn't fixed the issue. Please add the check for proper QT version in configure script. Thank you.

nurupo commented 11 years ago

Looks like you weren't following the build instructions close enough, since it tells to use Qt5. INSTALL.md