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

Errors 5002 and 5003

Open dropbear32 opened this issue 5 years ago • 16 comments

I can't seem to avoid these two errors. I've tried all the fixes in issues https://github.com/yourWaifu/sleepy-discord/issues/140, https://github.com/yourWaifu/sleepy-discord/issues/108, and https://github.com/yourWaifu/sleepy-discord/issues/128. None of them work for me.

I'm using Linux and WebSocket++.

If there's any other info I can provide about my system, let me know and I'll post it.

dropbear32 avatar Mar 28 '19 15:03 dropbear32

are you using cmake?

yourWaifu avatar Mar 28 '19 18:03 yourWaifu

if so, I think I might have a solution. on this line https://github.com/yourWaifu/sleepy-discord/blob/54ef5357eb40bc3b1cc9a7c85e38b13ed1bef61c/CMakeLists.txt#L49

add this

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
	#using cmake to configure curl on linux has issues
	#so use system curl
	set(USE_SYSTEM_CURL ON CACHE INTERNAL BOOL "")
endif()

yourWaifu avatar Mar 28 '19 19:03 yourWaifu

I am using cmake. Adding those lines to $projdir/sleepy-discord/CMakeLists.txt didn't do anything, but if I removed the conditional it had some kind of effect. However, now, when i run make, I receive errors saying Undefined reference to and listing a bunch of things starting with ldap and libssh2.

dropbear32 avatar Mar 28 '19 19:03 dropbear32

can you give me the output from make?

yourWaifu avatar Mar 28 '19 19:03 yourWaifu

atirit@arch:~/code/cpp/discordpp$ make
Scanning dependencies of target cpr
[  2%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/auth.cpp.o
[  4%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/cookies.cpp.o
[  6%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/cprtypes.cpp.o
[  9%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/digest.cpp.o
[ 11%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/error.cpp.o
[ 13%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/multipart.cpp.o
[ 16%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/parameters.cpp.o
[ 18%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/payload.cpp.o
[ 20%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/proxies.cpp.o
[ 23%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/session.cpp.o
[ 25%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/timeout.cpp.o
[ 27%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/util.cpp.o
[ 30%] Building CXX object sleepy-discord/deps/cpr/cpr/CMakeFiles/cpr.dir/ssl_options.cpp.o
[ 32%] Linking CXX static library ../../../../lib/libcpr.a
[ 32%] Built target cpr
Scanning dependencies of target sleepy-discord
[ 34%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/asignments_client.cpp.o
[ 37%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/attachment.cpp.o
[ 39%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/channel.cpp.o
[ 41%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/client.cpp.o
[ 44%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/cpr_session.cpp.o
[ 46%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/default_functions.cpp.o
[ 48%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/discord_object_interface.cpp.o
[ 51%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/embed.cpp.o
[ 53%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/endpoints.cpp.o
[ 55%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/experimental.cpp.o
[ 58%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/gateway.cpp.o
[ 60%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/http.cpp.o
[ 62%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/invite.cpp.o
[ 65%] Building C object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/json.c.o
[ 67%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/json_wrapper.cpp.o
[ 69%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/message.cpp.o
[ 72%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/permissions.cpp.o
[ 74%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/sd_error.cpp.o
[ 76%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/server.cpp.o
[ 79%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/user.cpp.o
[ 81%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/uwebsockets_websocket.cpp.o
[ 83%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/voice.cpp.o
[ 86%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/webhook.cpp.o
[ 88%] Building CXX object sleepy-discord/sleepy_discord/CMakeFiles/sleepy-discord.dir/websocketpp_websocket.cpp.o
In file included from /home/atirit/code/cpp/discordpp/sleepy-discord/sleepy_discord/websocketpp_websocket.cpp:1:
/home/atirit/code/cpp/discordpp/sleepy-discord/include/sleepy_discord/websocketpp_websocket.h: In constructor ‘SleepyDiscord::WebsocketppDiscordClient::WebsocketppDiscordClient(std::__cxx11::string, char)’:
/home/atirit/code/cpp/discordpp/sleepy-discord/include/sleepy_discord/websocketpp_websocket.h:42:14: warning: ‘SleepyDiscord::WebsocketppDiscordClient::maxNumOfThreads’ will be initialized after [-Wreorder]
   const char maxNumOfThreads;
              ^~~~~~~~~~~~~~~
/home/atirit/code/cpp/discordpp/sleepy-discord/include/sleepy_discord/websocketpp_websocket.h:39:58: warning:   ‘std::shared_ptr<std::thread> SleepyDiscord::WebsocketppDiscordClient::_thread’ [-Wreorder]
   websocketpp::lib::shared_ptr<websocketpp::lib::thread> _thread;
                                                          ^~~~~~~
/home/atirit/code/cpp/discordpp/sleepy-discord/sleepy_discord/websocketpp_websocket.cpp:6:2: warning:   when initialized here [-Wreorder]
  WebsocketppDiscordClient::WebsocketppDiscordClient(const std::string token, const char numOfThreads) :
  ^~~~~~~~~~~~~~~~~~~~~~~~
[ 90%] Linking CXX static library libsleepy-discord.a
[ 90%] Built target sleepy-discord
Scanning dependencies of target discordpp
[ 93%] Building CXX object CMakeFiles/discordpp.dir/DiscordApp.cpp.o
[ 95%] Building CXX object CMakeFiles/discordpp.dir/MessageBoxTextCtrl.cpp.o
[ 97%] Building CXX object CMakeFiles/discordpp.dir/DiscordPPClient.cpp.o
[100%] Linking CXX executable discordpp
/usr/bin/ld: /usr/local/lib/libcurl.a(version.c.o): in function `curl_version':
version.c:(.text+0x1ab): undefined reference to `libssh2_version'
/usr/bin/ld: /usr/local/lib/libcurl.a(easy.c.o): in function `global_init':
easy.c:(.text+0x35d): undefined reference to `libssh2_init'
/usr/bin/ld: /usr/local/lib/libcurl.a(easy.c.o): in function `curl_global_cleanup':
easy.c:(.text+0x4c6): undefined reference to `libssh2_exit'
/usr/bin/ld: /usr/local/lib/libcurl.a(ldap.c.o): in function `Curl_ldap':
ldap.c:(.text+0x204): undefined reference to `ldap_url_parse'
/usr/bin/ld: ldap.c:(.text+0x220): undefined reference to `ldap_err2string'
/usr/bin/ld: ldap.c:(.text+0x301): undefined reference to `ldap_set_option'
/usr/bin/ld: ldap.c:(.text+0x31a): undefined reference to `ldap_set_option'
/usr/bin/ld: ldap.c:(.text+0x341): undefined reference to `ldap_init'
/usr/bin/ld: ldap.c:(.text+0x3af): undefined reference to `ldap_simple_bind_s'
/usr/bin/ld: ldap.c:(.text+0x3ec): undefined reference to `ldap_set_option'
/usr/bin/ld: ldap.c:(.text+0x406): undefined reference to `ldap_simple_bind_s'
/usr/bin/ld: ldap.c:(.text+0x422): undefined reference to `ldap_err2string'
/usr/bin/ld: ldap.c:(.text+0x498): undefined reference to `ldap_search_s'
/usr/bin/ld: ldap.c:(.text+0x4c1): undefined reference to `ldap_err2string'
/usr/bin/ld: ldap.c:(.text+0x50e): undefined reference to `ldap_first_entry'
/usr/bin/ld: ldap.c:(.text+0x53e): undefined reference to `ldap_get_dn'
/usr/bin/ld: ldap.c:(.text+0x595): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0x5d1): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0x611): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0x635): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0x655): undefined reference to `ldap_first_attribute'
/usr/bin/ld: ldap.c:(.text+0x693): undefined reference to `ldap_get_values_len'
/usr/bin/ld: ldap.c:(.text+0x6ec): undefined reference to `ldap_value_free_len'
/usr/bin/ld: ldap.c:(.text+0x6f8): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0x71c): undefined reference to `ber_free'
/usr/bin/ld: ldap.c:(.text+0x758): undefined reference to `ldap_value_free_len'
/usr/bin/ld: ldap.c:(.text+0x764): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0x788): undefined reference to `ber_free'
/usr/bin/ld: ldap.c:(.text+0x7c8): undefined reference to `ldap_value_free_len'
/usr/bin/ld: ldap.c:(.text+0x7d4): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0x7f8): undefined reference to `ber_free'
/usr/bin/ld: ldap.c:(.text+0x8b4): undefined reference to `ldap_value_free_len'
/usr/bin/ld: ldap.c:(.text+0x8c0): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0x8e4): undefined reference to `ber_free'
/usr/bin/ld: ldap.c:(.text+0x949): undefined reference to `ldap_value_free_len'
/usr/bin/ld: ldap.c:(.text+0x955): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0x979): undefined reference to `ber_free'
/usr/bin/ld: ldap.c:(.text+0x9ff): undefined reference to `ldap_value_free_len'
/usr/bin/ld: ldap.c:(.text+0xa0b): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0xa2f): undefined reference to `ber_free'
/usr/bin/ld: ldap.c:(.text+0xa97): undefined reference to `ldap_value_free_len'
/usr/bin/ld: ldap.c:(.text+0xaa3): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0xac7): undefined reference to `ber_free'
/usr/bin/ld: ldap.c:(.text+0xb07): undefined reference to `ldap_value_free_len'
/usr/bin/ld: ldap.c:(.text+0xb13): undefined reference to `ldap_memfree'
/usr/bin/ld: ldap.c:(.text+0xb7e): undefined reference to `ldap_next_attribute'
/usr/bin/ld: ldap.c:(.text+0xbad): undefined reference to `ber_free'
/usr/bin/ld: ldap.c:(.text+0xbc6): undefined reference to `ldap_next_entry'
/usr/bin/ld: ldap.c:(.text+0xc15): undefined reference to `ldap_msgfree'
/usr/bin/ld: ldap.c:(.text+0xc57): undefined reference to `ldap_free_urldesc'
/usr/bin/ld: ldap.c:(.text+0xc70): undefined reference to `ldap_unbind_s'
/usr/bin/ld: /usr/local/lib/libcurl.a(ssh.c.o): in function `ssh_knownhost':
ssh.c:(.text+0x616): undefined reference to `libssh2_session_hostkey'
/usr/bin/ld: ssh.c:(.text+0x6ee): undefined reference to `libssh2_knownhost_checkp'
/usr/bin/ld: ssh.c:(.text+0x87d): undefined reference to `libssh2_knownhost_add'
/usr/bin/ld: ssh.c:(.text+0x8e1): undefined reference to `libssh2_knownhost_writefile'
/usr/bin/ld: /usr/local/lib/libcurl.a(ssh.c.o): in function `ssh_check_fingerprint':
ssh.c:(.text+0x986): undefined reference to `libssh2_hostkey_hash'
/usr/bin/ld: /usr/local/lib/libcurl.a(ssh.c.o): in function `ssh_statemach_act':
ssh.c:(.text+0xc00): undefined reference to `libssh2_session_set_blocking'
/usr/bin/ld: ssh.c:(.text+0xc32): undefined reference to `libssh2_session_handshake'
/usr/bin/ld: ssh.c:(.text+0xd26): undefined reference to `libssh2_userauth_list'
/usr/bin/ld: ssh.c:(.text+0xd5c): undefined reference to `libssh2_userauth_authenticated'
/usr/bin/ld: ssh.c:(.text+0xdb5): undefined reference to `libssh2_session_last_errno'
/usr/bin/ld: ssh.c:(.text+0x13b2): undefined reference to `libssh2_userauth_publickey_fromfile_ex'
/usr/bin/ld: ssh.c:(.text+0x1480): undefined reference to `libssh2_session_last_error'
/usr/bin/ld: ssh.c:(.text+0x15b4): undefined reference to `libssh2_userauth_password_ex'
/usr/bin/ld: ssh.c:(.text+0x1716): undefined reference to `libssh2_agent_init'
/usr/bin/ld: ssh.c:(.text+0x1784): undefined reference to `libssh2_agent_connect'
/usr/bin/ld: ssh.c:(.text+0x1825): undefined reference to `libssh2_agent_list_identities'
/usr/bin/ld: ssh.c:(.text+0x18df): undefined reference to `libssh2_agent_get_identity'
/usr/bin/ld: ssh.c:(.text+0x1930): undefined reference to `libssh2_agent_userauth'
/usr/bin/ld: ssh.c:(.text+0x1ace): undefined reference to `libssh2_userauth_keyboard_interactive_ex'
/usr/bin/ld: ssh.c:(.text+0x1c4f): undefined reference to `libssh2_sftp_init'
/usr/bin/ld: ssh.c:(.text+0x1c8d): undefined reference to `libssh2_session_last_errno'
/usr/bin/ld: ssh.c:(.text+0x1cc8): undefined reference to `libssh2_session_last_error'
/usr/bin/ld: ssh.c:(.text+0x1d6c): undefined reference to `libssh2_sftp_symlink_ex'
/usr/bin/ld: ssh.c:(.text+0x1e48): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x29de): undefined reference to `libssh2_sftp_stat_ex'
/usr/bin/ld: ssh.c:(.text+0x2a2d): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x2f40): undefined reference to `libssh2_sftp_stat_ex'
/usr/bin/ld: ssh.c:(.text+0x2f8f): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x30d5): undefined reference to `libssh2_sftp_symlink_ex'
/usr/bin/ld: ssh.c:(.text+0x3124): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x3246): undefined reference to `libssh2_sftp_mkdir_ex'
/usr/bin/ld: ssh.c:(.text+0x3295): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x33b5): undefined reference to `libssh2_sftp_rename_ex'
/usr/bin/ld: ssh.c:(.text+0x3404): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x3518): undefined reference to `libssh2_sftp_rmdir_ex'
/usr/bin/ld: ssh.c:(.text+0x3567): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x3655): undefined reference to `libssh2_sftp_unlink_ex'
/usr/bin/ld: ssh.c:(.text+0x36a4): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x379c): undefined reference to `libssh2_sftp_statvfs'
/usr/bin/ld: ssh.c:(.text+0x37eb): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x3a6f): undefined reference to `libssh2_sftp_stat_ex'
/usr/bin/ld: ssh.c:(.text+0x3bbf): undefined reference to `libssh2_sftp_stat_ex'
/usr/bin/ld: ssh.c:(.text+0x3cf4): undefined reference to `libssh2_sftp_open_ex'
/usr/bin/ld: ssh.c:(.text+0x3d32): undefined reference to `libssh2_session_last_errno'
/usr/bin/ld: ssh.c:(.text+0x3d64): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x4188): undefined reference to `libssh2_sftp_seek64'
/usr/bin/ld: ssh.c:(.text+0x4410): undefined reference to `libssh2_sftp_mkdir_ex'
/usr/bin/ld: ssh.c:(.text+0x4477): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x459d): undefined reference to `libssh2_sftp_open_ex'
/usr/bin/ld: ssh.c:(.text+0x45db): undefined reference to `libssh2_session_last_errno'
/usr/bin/ld: ssh.c:(.text+0x4605): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x47d2): undefined reference to `libssh2_sftp_readdir_ex'
/usr/bin/ld: ssh.c:(.text+0x4ce6): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x4d3d): undefined reference to `libssh2_session_last_errno'
/usr/bin/ld: ssh.c:(.text+0x4e3e): undefined reference to `libssh2_sftp_symlink_ex'
/usr/bin/ld: ssh.c:(.text+0x51f8): undefined reference to `libssh2_sftp_close_handle'
/usr/bin/ld: ssh.c:(.text+0x531d): undefined reference to `libssh2_sftp_open_ex'
/usr/bin/ld: ssh.c:(.text+0x535b): undefined reference to `libssh2_session_last_errno'
/usr/bin/ld: ssh.c:(.text+0x5385): undefined reference to `libssh2_sftp_last_error'
/usr/bin/ld: ssh.c:(.text+0x5470): undefined reference to `libssh2_sftp_stat_ex'
/usr/bin/ld: ssh.c:(.text+0x5732): undefined reference to `libssh2_sftp_seek64'
/usr/bin/ld: ssh.c:(.text+0x593b): undefined reference to `libssh2_sftp_seek64'
/usr/bin/ld: ssh.c:(.text+0x5a94): undefined reference to `libssh2_sftp_close_handle'
/usr/bin/ld: ssh.c:(.text+0x5ba9): undefined reference to `libssh2_sftp_close_handle'
/usr/bin/ld: ssh.c:(.text+0x5c1b): undefined reference to `libssh2_sftp_shutdown'
/usr/bin/ld: ssh.c:(.text+0x5e05): undefined reference to `libssh2_scp_send64'
/usr/bin/ld: ssh.c:(.text+0x5e43): undefined reference to `libssh2_session_last_errno'
/usr/bin/ld: ssh.c:(.text+0x5e7e): undefined reference to `libssh2_session_last_error'
/usr/bin/ld: ssh.c:(.text+0x5fec): undefined reference to `libssh2_scp_recv2'
/usr/bin/ld: ssh.c:(.text+0x602a): undefined reference to `libssh2_session_last_errno'
/usr/bin/ld: ssh.c:(.text+0x6065): undefined reference to `libssh2_session_last_error'
/usr/bin/ld: ssh.c:(.text+0x61ff): undefined reference to `libssh2_channel_send_eof'
/usr/bin/ld: ssh.c:(.text+0x6278): undefined reference to `libssh2_channel_wait_eof'
/usr/bin/ld: ssh.c:(.text+0x62f7): undefined reference to `libssh2_channel_wait_closed'
/usr/bin/ld: ssh.c:(.text+0x6376): undefined reference to `libssh2_channel_free'
/usr/bin/ld: ssh.c:(.text+0x6411): undefined reference to `libssh2_channel_free'
/usr/bin/ld: ssh.c:(.text+0x6496): undefined reference to `libssh2_session_disconnect_ex'
/usr/bin/ld: ssh.c:(.text+0x6550): undefined reference to `libssh2_knownhost_free'
/usr/bin/ld: ssh.c:(.text+0x658f): undefined reference to `libssh2_agent_disconnect'
/usr/bin/ld: ssh.c:(.text+0x65dc): undefined reference to `libssh2_agent_free'
/usr/bin/ld: ssh.c:(.text+0x663b): undefined reference to `libssh2_session_free'
/usr/bin/ld: /usr/local/lib/libcurl.a(ssh.c.o): in function `ssh_block2waitfor':
ssh.c:(.text+0x6a0d): undefined reference to `libssh2_session_block_directions'
/usr/bin/ld: /usr/local/lib/libcurl.a(ssh.c.o): in function `ssh_block_statemach':
ssh.c:(.text+0x6bfe): undefined reference to `libssh2_session_block_directions'
/usr/bin/ld: /usr/local/lib/libcurl.a(ssh.c.o): in function `ssh_connect':
ssh.c:(.text+0x6dba): undefined reference to `libssh2_session_init_ex'
/usr/bin/ld: ssh.c:(.text+0x6e26): undefined reference to `libssh2_session_flag'
/usr/bin/ld: ssh.c:(.text+0x6e69): undefined reference to `libssh2_knownhost_init'
/usr/bin/ld: ssh.c:(.text+0x6eb4): undefined reference to `libssh2_knownhost_readfile'
/usr/bin/ld: /usr/local/lib/libcurl.a(ssh.c.o): in function `scp_send':
ssh.c:(.text+0x7225): undefined reference to `libssh2_channel_write_ex'
/usr/bin/ld: /usr/local/lib/libcurl.a(ssh.c.o): in function `scp_recv':
ssh.c:(.text+0x72c0): undefined reference to `libssh2_channel_read_ex'
/usr/bin/ld: /usr/local/lib/libcurl.a(ssh.c.o): in function `sftp_send':
ssh.c:(.text+0x749f): undefined reference to `libssh2_sftp_write'
/usr/bin/ld: /usr/local/lib/libcurl.a(ssh.c.o): in function `sftp_recv':
ssh.c:(.text+0x7538): undefined reference to `libssh2_sftp_read'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/discordpp.dir/build.make:117: discordpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:74: CMakeFiles/discordpp.dir/all] Error 2
make: *** [Makefile:130: all] Error 2```

dropbear32 avatar Mar 28 '19 19:03 dropbear32

in https://github.com/yourWaifu/sleepy-discord/blob/54ef5357eb40bc3b1cc9a7c85e38b13ed1bef61c/sleepy_discord/CMakeLists.txt#L50 add

target_link_libraries(sleepy-discord PUBLIC ssh2)

if that doesn't work try doing this https://stackoverflow.com/a/10270698

yourWaifu avatar Mar 28 '19 19:03 yourWaifu

That line removes all the errors but I still get 5002 and 5003. I'm on Arch, so I don't have access to apt, but I have libssh2 installed via pacman.

dropbear32 avatar Mar 28 '19 20:03 dropbear32

do you have the package libcurl-gnutls?

yourWaifu avatar Mar 28 '19 20:03 yourWaifu

atirit@arch:~/code/cpp/discordpp$ yaourt -Ssq libcurl
curl
python-pycurl
python2-pycurl
curlftpfs
gnurl
libcurl-compat
libcurl-gnutls
lib32-libcurl-compat
lib32-libcurl-gnutls
deacme-git
haskell-curl
libcurl-openssl-1.0
libcurl3-gnutls
libcurlpp
ocaml-curl
perl-net-curl
perl6-libcurl
perl6-net-curl
pillowtalk-git
ros-ardent-libcurl-vendor
ruby-ethon
ruby-typhoeus
ruby-typhoeus-0.6
saldl-git
zsync-curl-git

Yes, along with a few other versions of libcurl for some reason.

dropbear32 avatar Mar 28 '19 20:03 dropbear32

add

if(response.error)
	std::cout << static_cast<int>(response.error.code) << ": " << response.error.message << '\n';

to https://github.com/yourWaifu/sleepy-discord/blob/54ef5357eb40bc3b1cc9a7c85e38b13ed1bef61c/sleepy_discord/cpr_session.cpp#L29 and add #include <iostream> to https://github.com/yourWaifu/sleepy-discord/blob/54ef5357eb40bc3b1cc9a7c85e38b13ed1bef61c/sleepy_discord/cpr_session.cpp#L3

compile and run and give me the output

yourWaifu avatar Mar 28 '19 20:03 yourWaifu

atirit@arch:~/code/cpp/discordpp$ ./discordpp
14: failed setting cipher list: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
Error 5002: Could not get the gateway
Error 5003: Connect initialization: invalid uri

dropbear32 avatar Mar 28 '19 20:03 dropbear32

I honestly have no idea how to fix that error, maybe try reinstalling libcurl.

yourWaifu avatar Mar 28 '19 21:03 yourWaifu

Reinstalling didn't work. I ended up putting this at the top of client.cpp:

#define SLEEPY_USE_HARD_CODED_GATEWAY

and using the fix in issue #128. That allows me to connect fine now.

dropbear32 avatar Mar 28 '19 23:03 dropbear32

Never mind; it crashes as soon as it receives a message. It gives the same error:

14: failed setting cipher list: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH

dropbear32 avatar Mar 29 '19 00:03 dropbear32

I'm having the same issue on Debian 9 using CMake and WebsocketPP.

ninigij avatar Apr 06 '19 01:04 ninigij

Issue is still present on Ubuntu 24.10 with default configuration.

Jake-Jensen avatar Aug 31 '22 03:08 Jake-Jensen