sleepy-discord icon indicating copy to clipboard operation
sleepy-discord copied to clipboard

Code error?

Open MiniAppleTheApple opened this issue 2 years ago • 3 comments

the code

#include "sleepy_discord/sleepy_discord.h"

class MyClientClass : public SleepyDiscord::DiscordClient {
public:
	using SleepyDiscord::DiscordClient::DiscordClient;
	void onMessage(SleepyDiscord::Message message) override {
		if (message.startsWith("whcg hello"))
			sendMessage(message.channelID, "Hello " + message.author.username);
	}
};

int main() {
	myClientClass client("token", SleepyDiscord::USER_CONTROLED_THREADS);
	client.run();
}

the error

n file included from /Users/thiagochenzhu/Documents/project/cpp-discord/sleepy-discord/deps/cpr/cpr/session.cpp:1:
In file included from /Users/thiagochenzhu/Documents/project/cpp-discord/sleepy-discord/deps/cpr/include/cpr/session.h:22:
/Users/thiagochenzhu/Documents/project/cpp-discord/sleepy-discord/deps/cpr/include/cpr/response.h:30:33: error: 
      use of undeclared identifier 'CURLINFO_SIZE_DOWNLOAD_T'; did you mean 'CURLINFO_SIZE_DOWNLOAD'?
        curl_easy_getinfo(curl, CURLINFO_SIZE_DOWNLOAD_T, &downloaded_bytes);
                                ^~~~~~~~~~~~~~~~~~~~~~~~
                                CURLINFO_SIZE_DOWNLOAD
/usr/include/curl/curl.h:2546:69: note: expanded from macro 'curl_easy_getinfo'
#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
                                                                    ^
/usr/include/curl/curl.h:2267:3: note: 'CURLINFO_SIZE_DOWNLOAD' declared here
  CURLINFO_SIZE_DOWNLOAD    = CURLINFO_DOUBLE + 8,
  ^
In file included from /Users/thiagochenzhu/Documents/project/cpp-discord/sleepy-discord/deps/cpr/cpr/session.cpp:1:
In file included from /Users/thiagochenzhu/Documents/project/cpp-discord/sleepy-discord/deps/cpr/include/cpr/session.h:22:
/Users/thiagochenzhu/Documents/project/cpp-discord/sleepy-discord/deps/cpr/include/cpr/response.h:31:33: error: 
      use of undeclared identifier 'CURLINFO_SIZE_UPLOAD_T'; did you mean 'CURLINFO_SIZE_UPLOAD'?
        curl_easy_getinfo(curl, CURLINFO_SIZE_UPLOAD_T, &uploaded_bytes);
                                ^~~~~~~~~~~~~~~~~~~~~~
                                CURLINFO_SIZE_UPLOAD
/usr/include/curl/curl.h:2546:69: note: expanded from macro 'curl_easy_getinfo'
#define curl_easy_getinfo(handle,info,arg) curl_easy_getinfo(handle,info,arg)
                                                                    ^
/usr/include/curl/curl.h:2266:3: note: 'CURLINFO_SIZE_UPLOAD' declared here
  CURLINFO_SIZE_UPLOAD      = CURLINFO_DOUBLE + 7,
  ^
2 errors generated.
make[2]: *** [sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/session.cpp.o] Error 1
make[1]: *** [sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/all] Error 2
make: *** [all] Error 2

MiniAppleTheApple avatar Nov 16 '21 03:11 MiniAppleTheApple

this looks like an error from a dependency called "cpr" which is not related to sleepy-discord maybe go find their github and put the issue there

eggveloper avatar Dec 04 '21 16:12 eggveloper

thank

MiniAppleTheApple avatar Dec 04 '21 20:12 MiniAppleTheApple

@MiniAppleTheApple https://github.com/libcpr/cpr

eggveloper avatar Dec 06 '21 18:12 eggveloper