adepierre / Botcraft

Botcraft is a cross-platform C++ library to create bots that connect and interact with Minecraft servers with (optional) integrated OpenGL renderer
GNU General Public License v3.0
405 stars 43 forks source link

undefined reference #85

Closed FloGo3308 closed 2 years ago

FloGo3308 commented 2 years ago

Can someone explain why it wont compile? I am verry new to C++(I have only used java and a bit of python before) and I have no clue what could be cousing these issues. I have added botcraft as a git submodule(git submodule add https://github.com/adepierre/Botcraft lib/botcraft). Oh and im using clion(idk if that helps).

CmakeLists.txt

cmake_minimum_required(VERSION 3.22)
project(czeropthreebot)

set(CMAKE_CXX_STANDARD 11)

add_executable(czeropthreebot src/main.cpp)

add_definitions(-DGAME_VERSION=1.12.2 -DBOTCRAFT_BUILD_EXAMPLES=ON -DBOTCRAFT_COMPRESSION=ON -DBOTCRAFT_ENCRYPTION=ON -DBOTCRAFT_USE_OPENGL_GUI=OFF) #doesnt work???????????
add_subdirectory(lib/botcraft EXCLUDE_FROM_ALL)
target_link_libraries(czeropthreebot PRIVATE botcraft)

The error

====================[ Build | czeropthreebot | Debug ]==========================
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\cmake\win\bin\cmake.exe --build C:\Users\keesg\CLionProjects\czeropthreebot\cmake-build-debug --target czeropthreebot -j 6
[1/3] Building CXX object CMakeFiles/czeropthreebot.dir/src/main.cpp.obj
[2/3] Linking CXX shared library ..\bin\libbotcraft_d.dll
FAILED: ../bin/libbotcraft_d.dll ../lib/libbotcraft_d.dll.a 
cmd.exe /C "cd . && C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin\g++.exe -g   -shared -o ..\bin\libbotcraft_d.dll -Wl,--out-implib,..\lib\libbotcraft_d.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\botcraft.rsp  && cd ."
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::winsock_init_base::startup(asio::detail::winsock_init_base::data&, unsigned char, unsigned char)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/winsock_init.ipp:38: undefined reference to `__imp_WSAStartup'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::winsock_init_base::cleanup(asio::detail::winsock_init_base::data&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/winsock_init.ipp:55: undefined reference to `__imp_WSACleanup'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::socket_ops::clear_last_error()':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:68: undefined reference to `__imp_WSASetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::socket_ops::close(unsigned long long, unsigned char&, bool, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:314: undefined reference to `__imp_closesocket'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:331: undefined reference to `__imp_ioctlsocket'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:346: undefined reference to `__imp_closesocket'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::socket_ops::recv(unsigned long long, _WSABUF*, unsigned long long, int, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:767: undefined reference to `__imp_WSARecv'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::socket_ops::send(unsigned long long, _WSABUF const*, unsigned long long, int, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1166: undefined reference to `__imp_WSASend'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::socket_ops::socket(int, int, int, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1394: undefined reference to `__imp_WSASocketW'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1405: undefined reference to `__imp_setsockopt'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::socket_ops::poll_read(unsigned long long, unsigned char, int, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1833: undefined reference to `__imp_select'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::socket_ops::poll_write(unsigned long long, unsigned char, int, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1887: undefined reference to `__imp_select'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::socket_ops::poll_connect(unsigned long long, int, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1991: undefined reference to `__imp_select'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::socket_ops::translate_addrinfo_error(int)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:3304: undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::socket_ops::getaddrinfo(char const*, char const*, addrinfo const&, addrinfo**, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:3322: undefined reference to `__imp_getaddrinfo'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `asio::detail::socket_ops::freeaddrinfo(addrinfo*)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:3396: undefined reference to `__imp_freeaddrinfo'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `unsigned long long asio::detail::socket_ops::error_wrapper<unsigned long long>(unsigned long long, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:81: undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `int asio::detail::socket_ops::error_wrapper<int>(int, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:81: undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `int asio::detail::socket_ops::call_connect<int>(int asio::detail::socket_ops::msghdr::*, unsigned long long, sockaddr const*, unsigned long long)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:469: undefined reference to `__imp_connect'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `int asio::detail::socket_ops::call_setsockopt<int>(int asio::detail::socket_ops::msghdr::*, unsigned long long, int, int, void const*, unsigned long long)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1440: undefined reference to `__imp_setsockopt'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/Authentifier.cpp.obj: in function `int asio::detail::socket_ops::call_getsockopt<int>(int asio::detail::socket_ops::msghdr::*, unsigned long long, int, int, void*, unsigned long long*)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1527: undefined reference to `__imp_getsockopt'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::win_fd_set_adapter::is_set(unsigned long long) const':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/win_fd_set_adapter.hpp:82: undefined reference to `__WSAFDIsSet'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::socket_ops::set_internal_non_blocking(unsigned long long, unsigned char&, bool, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:423: undefined reference to `__imp_ioctlsocket'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::socket_ops::non_blocking_connect(unsigned long long, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:573: undefined reference to `__imp_select'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::socket_ops::listen(unsigned long long, int, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:691: undefined reference to `__imp_listen'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::socket_ops::recvfrom(unsigned long long, _WSABUF*, unsigned long long, int, sockaddr*, unsigned long long*, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:920: undefined reference to `__imp_WSARecvFrom'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::socket_ops::sendto(unsigned long long, _WSABUF const*, unsigned long long, int, sockaddr const*, unsigned long long, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1292: undefined reference to `__imp_WSASendTo'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::socket_ops::ioctl(unsigned long long, unsigned char&, int, unsigned long*, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1724: undefined reference to `__imp_ioctlsocket'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::socket_ops::select(int, fd_set*, fd_set*, fd_set*, timeval*, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1793: undefined reference to `__imp_select'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::socket_ops::inet_pton(int, char const*, void*, unsigned long*, std::error_code&)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:2304: undefined reference to `__imp_WSAStringToAddressA'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::socket_ops::network_to_host_long(unsigned long)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:3521: undefined reference to `__imp_ntohl'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::socket_ops::host_to_network_long(unsigned long)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:3536: undefined reference to `__imp_htonl'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::socket_ops::host_to_network_short(unsigned short)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:3561: undefined reference to `__imp_htons'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::win_iocp_socket_service_base::start_send_op(asio::detail::win_iocp_socket_service_base::base_implementation_type&, _WSABUF*, unsigned long long, int, bool, asio::detail::win_iocp_operation*)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp:397: undefined reference to `__imp_WSASend'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp:399: undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::win_iocp_socket_service_base::start_receive_op(asio::detail::win_iocp_socket_service_base::base_implementation_type&, _WSABUF*, unsigned long long, int, bool, asio::detail::win_iocp_operation*)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp:452: undefined reference to `__imp_WSARecv'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp:455: undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::win_iocp_socket_service_base::start_connect_op(asio::detail::win_iocp_socket_service_base::base_implementation_type&, int, int, sockaddr const*, unsigned long long, asio::detail::win_iocp_socket_connect_op_base*)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp:625: undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `asio::detail::win_iocp_socket_service_base::get_connect_ex(asio::detail::win_iocp_socket_service_base::base_implementation_type&, int)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/win_iocp_socket_service_base.ipp:736: undefined reference to `__imp_WSAIoctl'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `unsigned long long asio::detail::socket_ops::call_accept<int>(int asio::detail::socket_ops::msghdr::*, unsigned long long, sockaddr*, unsigned long long*)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:95: undefined reference to `__imp_accept'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `int asio::detail::socket_ops::call_bind<int>(int asio::detail::socket_ops::msghdr::*, unsigned long long, sockaddr const*, unsigned long long)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:273: undefined reference to `__imp_bind'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Network/TCP_Com.cpp.obj: in function `int asio::detail::socket_ops::call_getsockname<int>(int asio::detail::socket_ops::msghdr::*, unsigned long long, sockaddr*, unsigned long long*)':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include/asio/detail/impl/socket_ops.ipp:1691: undefined reference to `__imp_getsockname'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_addr.c.obj):b_addr.c:(.text+0x456): undefined reference to `__imp_getnameinfo'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_addr.c.obj):b_addr.c:(.text+0x498): undefined reference to `gai_strerrorA'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_addr.c.obj):b_addr.c:(.text+0x4cf): undefined reference to `__imp_ntohs'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_addr.c.obj):b_addr.c:(.text+0x843): undefined reference to `__imp_freeaddrinfo'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_addr.c.obj):b_addr.c:(.text+0xe3f): undefined reference to `__imp_getaddrinfo'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_addr.c.obj):b_addr.c:(.text+0xee1): undefined reference to `gai_strerrorA'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x2a6): undefined reference to `__imp_ntohs'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x328): undefined reference to `__imp_getsockopt'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x33a): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x35e): undefined reference to `__imp_gethostbyname'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x3b6): undefined reference to `__imp_WSAStartup'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x3c3): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x445): undefined reference to `__imp_WSACleanup'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x479): undefined reference to `__imp_ioctlsocket'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x48b): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x68b): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x866): undefined reference to `__imp_setsockopt'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x915): undefined reference to `__imp_getsockname'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock.c.obj):b_sock.c:(.text+0x927): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x3f): undefined reference to `__imp_socket'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x51): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x156): undefined reference to `__imp_setsockopt'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x163): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x1eb): undefined reference to `__imp_setsockopt'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x1f8): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x278): undefined reference to `__imp_connect'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x294): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x367): undefined reference to `__imp_bind'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x374): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x44d): undefined reference to `__imp_getsockopt'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x462): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x510): undefined reference to `__imp_setsockopt'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x51d): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x5a5): undefined reference to `__imp_setsockopt'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x5b2): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x64c): undefined reference to `__imp_setsockopt'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x659): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x6e6): undefined reference to `__imp_listen'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x6f4): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x7a1): undefined reference to `__imp_accept'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x7c1): undefined reference to `__imp_WSAGetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x83a): undefined reference to `__imp_closesocket'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(b_sock2.c.obj):b_sock2.c:(.text+0x866): undefined reference to `__imp_closesocket'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(bss_sock.c.obj):bss_sock.c:(.text+0x166): undefined reference to `__imp_WSASetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(bss_sock.c.obj):bss_sock.c:(.text+0x18b): undefined reference to `__imp_recv'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(bss_sock.c.obj):bss_sock.c:(.text+0x204): undefined reference to `__imp_WSASetLastError'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(bss_sock.c.obj):bss_sock.c:(.text+0x229): undefined reference to `__imp_send'
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin/ld.exe: lib/botcraft/3rdparty/openssl/install/lib/libcrypto.a(bss_sock.c.obj):bss_sock.c:(.text+0x3f2): undefined reference to `__imp_WSAGetLastError'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
adepierre commented 2 years ago

Hi!

I don't have any experience with Windows build using mingw, but I have a few suggestions that could help you to get a working build.

First, instead of add_definitions, try to use set instead (with new CMP0077 because cmake retro compatibility stuff):

cmake_policy(SET CMP0077 NEW)
set(BOTCRAFT_COMPRESSION OFF)
set(BOTCRAFT_ENCRYPTION OFF)
set(GAME_VERSION 1.12.2)
...

Then try to build first without compression and encryption support. Given you log file, I guess the issue is that some "os specific" functions are not found properly? I've no idea, but first try to check if you can get it build without encryption and compression and then we'll try to figure out from here.

FloGo3308 commented 2 years ago

Thanks for the super quick response! My new cmake file thingie looks like this

cmake_minimum_required(VERSION 3.22)
project(czeropthreebot)

set(CMAKE_CXX_STANDARD 11)

add_executable(czeropthreebot src/main.cpp)

cmake_policy(SET CMP0077 NEW)
set(BOTCRAFT_COMPRESSION OFF)
set(BOTCRAFT_ENCRYPTION OFF)
set(GAME_VERSION 1.12.2)

add_subdirectory(lib/botcraft) # EXCLUDE_FROM_ALL
target_link_libraries(czeropthreebot PRIVATE botcraft)

Now it gives a new error(well errors...), but progress nonetheless. It now spits out even weirder stuff(the weirdest thing is that the number(182 from [1/182] Building CXX object) decreises everytime i try to run my code...)

====================[ Build | czeropthreebot | Debug ]==========================
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\cmake\win\bin\cmake.exe --build C:\Users\keesg\CLionProjects\czeropthreebot\cmake-build-debug --target czeropthreebot -j 6
[1/182] Building CXX object lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Game/Entities/entities/monster/AbstractSkeletonEntity.cpp.obj
FAILED: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Game/Entities/entities/monster/AbstractSkeletonEntity.cpp.obj 
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin\g++.exe -DASIO_STANDALONE -DASSETS_PATH=\"./Assets/1.12.2\" -DPROTOCOL_VERSION=340 -Dbotcraft_EXPORTS -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include -IC:/Users/keesg/CLionProjects/czeropthreebot/cmake-build-debug/lib/botcraft/botcraft/include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/private_include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/json/include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include -isystem C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include -g -std=gnu++17 -MD -MT lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Game/Entities/entities/monster/AbstractSkeletonEntity.cpp.obj -MF lib\botcraft\botcraft\CMakeFiles\botcraft.dir\src\Game\Entities\entities\monster\AbstractSkeletonEntity.cpp.obj.d -o lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Game/Entities/entities/monster/AbstractSkeletonEntity.cpp.obj -c C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/src/Game/Entities/entities/monster/AbstractSkeletonEntity.cpp
In file included from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/Entities/entities/Entity.hpp:13,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/Entities/entities/LivingEntity.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/Entities/entities/MobEntity.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/Entities/entities/PathfinderMobEntity.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/Entities/entities/monster/MonsterEntity.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/Entities/entities/monster/AbstractSkeletonEntity.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/src/Game/Entities/entities/monster/AbstractSkeletonEntity.cpp:1:
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp: In member function 'const bool ProtocolCraft::Slot::SameItem(const ProtocolCraft::Slot&) const':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:20: error: 'item_id' was not declared in this scope
   50 |             return item_id == s.GetItemID();
      |                    ^~~~~~~
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:33: error: 'const class ProtocolCraft::Slot' has no member named 'GetItemID'
   50 |             return item_id == s.GetItemID();
      |                                 ^~~~~~~~~
[2/182] Building CXX object lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Game/Entities/entities/PathfinderMobEntity.cpp.obj
FAILED: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Game/Entities/entities/PathfinderMobEntity.cpp.obj 
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin\g++.exe -DASIO_STANDALONE -DASSETS_PATH=\"./Assets/1.12.2\" -DPROTOCOL_VERSION=340 -Dbotcraft_EXPORTS -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include -IC:/Users/keesg/CLionProjects/czeropthreebot/cmake-build-debug/lib/botcraft/botcraft/include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/private_include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/json/include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include -isystem C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include -g -std=gnu++17 -MD -MT lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Game/Entities/entities/PathfinderMobEntity.cpp.obj -MF lib\botcraft\botcraft\CMakeFiles\botcraft.dir\src\Game\Entities\entities\PathfinderMobEntity.cpp.obj.d -o lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/Game/Entities/entities/PathfinderMobEntity.cpp.obj -c C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/src/Game/Entities/entities/PathfinderMobEntity.cpp
In file included from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/Entities/entities/Entity.hpp:13,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/Entities/entities/LivingEntity.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/Entities/entities/MobEntity.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/Entities/entities/PathfinderMobEntity.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/src/Game/Entities/entities/PathfinderMobEntity.cpp:1:
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp: In member function 'const bool ProtocolCraft::Slot::SameItem(const ProtocolCraft::Slot&) const':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:20: error: 'item_id' was not declared in this scope
   50 |             return item_id == s.GetItemID();
      |                    ^~~~~~~
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:33: error: 'const class ProtocolCraft::Slot' has no member named 'GetItemID'
   50 |             return item_id == s.GetItemID();
      |                                 ^~~~~~~~~
[3/182] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/BaseMessage.cpp.obj
FAILED: lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/BaseMessage.cpp.obj 
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin\g++.exe -DPROTOCOL_VERSION=340 -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/json/include -g -std=gnu++11 -MD -MT lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/BaseMessage.cpp.obj -MF lib\botcraft\protocolCraft\CMakeFiles\protocolCraft.dir\src\BaseMessage.cpp.obj.d -o lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/BaseMessage.cpp.obj -c C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/src/BaseMessage.cpp
In file included from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Messages/Play/Serverbound/ServerboundContainerClickPacket.hpp:4,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/AllMessages.hpp:42,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/src/BaseMessage.cpp:2:
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp: In member function 'const bool ProtocolCraft::Slot::SameItem(const ProtocolCraft::Slot&) const':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:20: error: 'item_id' was not declared in this scope
   50 |             return item_id == s.GetItemID();
      |                    ^~~~~~~
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:33: error: 'const class ProtocolCraft::Slot' has no member named 'GetItemID'
   50 |             return item_id == s.GetItemID();
      |                                 ^~~~~~~~~
[4/182] Building CXX object lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/BehaviourClient.cpp.obj
FAILED: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/BehaviourClient.cpp.obj 
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin\g++.exe -DASIO_STANDALONE -DASSETS_PATH=\"./Assets/1.12.2\" -DPROTOCOL_VERSION=340 -Dbotcraft_EXPORTS -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include -IC:/Users/keesg/CLionProjects/czeropthreebot/cmake-build-debug/lib/botcraft/botcraft/include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/private_include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/json/include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include -isystem C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include -g -std=gnu++17 -MD -MT lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/BehaviourClient.cpp.obj -MF lib\botcraft\botcraft\CMakeFiles\botcraft.dir\src\AI\BehaviourClient.cpp.obj.d -o lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/BehaviourClient.cpp.obj -c C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/src/AI/BehaviourClient.cpp
In file included from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Messages/Play/Serverbound/ServerboundContainerClickPacket.hpp:4,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/AllMessages.hpp:42,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Handler.hpp:5,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/ManagersClient.hpp:6,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/AI/BehaviourClient.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/src/AI/BehaviourClient.cpp:1:
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp: In member function 'const bool ProtocolCraft::Slot::SameItem(const ProtocolCraft::Slot&) const':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:20: error: 'item_id' was not declared in this scope
   50 |             return item_id == s.GetItemID();
      |                    ^~~~~~~
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:33: error: 'const class ProtocolCraft::Slot' has no member named 'GetItemID'
   50 |             return item_id == s.GetItemID();
      |                                 ^~~~~~~~~
[5/182] Building CXX object lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/SimpleBehaviourClient.cpp.obj
FAILED: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/SimpleBehaviourClient.cpp.obj 
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin\g++.exe -DASIO_STANDALONE -DASSETS_PATH=\"./Assets/1.12.2\" -DPROTOCOL_VERSION=340 -Dbotcraft_EXPORTS -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include -IC:/Users/keesg/CLionProjects/czeropthreebot/cmake-build-debug/lib/botcraft/botcraft/include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/private_include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/json/include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include -isystem C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include -g -std=gnu++17 -MD -MT lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/SimpleBehaviourClient.cpp.obj -MF lib\botcraft\botcraft\CMakeFiles\botcraft.dir\src\AI\SimpleBehaviourClient.cpp.obj.d -o lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/SimpleBehaviourClient.cpp.obj -c C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/src/AI/SimpleBehaviourClient.cpp
In file included from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Messages/Play/Serverbound/ServerboundContainerClickPacket.hpp:4,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/AllMessages.hpp:42,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Handler.hpp:5,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/ManagersClient.hpp:6,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/AI/BehaviourClient.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/AI/TemplatedBehaviourClient.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/AI/SimpleBehaviourClient.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/src/AI/SimpleBehaviourClient.cpp:1:
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp: In member function 'const bool ProtocolCraft::Slot::SameItem(const ProtocolCraft::Slot&) const':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:20: error: 'item_id' was not declared in this scope
   50 |             return item_id == s.GetItemID();
      |                    ^~~~~~~
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:33: error: 'const class ProtocolCraft::Slot' has no member named 'GetItemID'
   50 |             return item_id == s.GetItemID();
      |                                 ^~~~~~~~~
[6/182] Building CXX object lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/Tasks/BaseTasks.cpp.obj
FAILED: lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/Tasks/BaseTasks.cpp.obj 
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5591.52\bin\mingw\bin\g++.exe -DASIO_STANDALONE -DASSETS_PATH=\"./Assets/1.12.2\" -DPROTOCOL_VERSION=340 -Dbotcraft_EXPORTS -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include -IC:/Users/keesg/CLionProjects/czeropthreebot/cmake-build-debug/lib/botcraft/botcraft/include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/private_include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/json/include -IC:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include -isystem C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/3rdparty/asio/asio/include -g -std=gnu++17 -MD -MT lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/Tasks/BaseTasks.cpp.obj -MF lib\botcraft\botcraft\CMakeFiles\botcraft.dir\src\AI\Tasks\BaseTasks.cpp.obj.d -o lib/botcraft/botcraft/CMakeFiles/botcraft.dir/src/AI/Tasks/BaseTasks.cpp.obj -c C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/src/AI/Tasks/BaseTasks.cpp
In file included from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Messages/Play/Serverbound/ServerboundContainerClickPacket.hpp:4,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/AllMessages.hpp:42,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Handler.hpp:5,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/Game/ManagersClient.hpp:6,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/AI/BehaviourClient.hpp:3,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/include/botcraft/AI/Tasks/BaseTasks.hpp:4,
                 from C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/botcraft/src/AI/Tasks/BaseTasks.cpp:1:
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp: In member function 'const bool ProtocolCraft::Slot::SameItem(const ProtocolCraft::Slot&) const':
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:20: error: 'item_id' was not declared in this scope
   50 |             return item_id == s.GetItemID();
      |                    ^~~~~~~
C:/Users/keesg/CLionProjects/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:33: error: 'const class ProtocolCraft::Slot' has no member named 'GetItemID'
   50 |             return item_id == s.GetItemID();
      |                                 ^~~~~~~~~
ninja: build stopped: subcommand failed.
FloGo3308 commented 2 years ago

I think ill commit and push my repo in its current state, delete the local repo and reclone to reset the cmake stuff(if you know a faster way please let me know :D)

adepierre commented 2 years ago

Ok so the new errors you get are actually from botcraft. You're building it with version 1.12.2 and I didn't test everything with this version for a while. I'll try to push a fix tonight.

For cmake, usually you just need to delete the cmake output folder. I don't know how it's done with clion, but from your log it looks like cmake-build-debug might be that? You should have some files like CMakeCache.txt in the folder you want to delete to "clean" cmake.

FloGo3308 commented 2 years ago

Hmmmm, it seems cmake doesnt like that CMP0077 policy you set, when the repo gets pulled it just gives a warning and then ignores the sets :( weird... image Btw, I dont need the version to be 1.12.2, I only chose that to minimize the amount of assets so I could start as quickly as possible testing this lib, but that doesnt matter anymore seeing the amout time I have already wasted on trying to get cmake to behave(it complained about not being able to find ninja and lots of other small things or smth, I dont think its related to this project).

Also, do you have a discord account? Because I think communication will be quicker through there.

I will go to bed right now, I will continue trying out everything I can tomorrow.

adepierre commented 2 years ago

For tomorrow you:

for the cmake stuff, you could alternatively add cache and force to the set command:

set(BOTCRAFT_COMPRESSION OFF CACHE BOOL "" FORCE)
set(BOTCRAFT_ENCRYPTION OFF CACHE BOOL "" FORCE)
set(GAME_VERSION 1.12.2 CACHE STRING "" FORCE)
...

About the discord server, I already tried once to setup one for this project, but as I don't use discord a lot myself, I never really finished it. Maybe I'll try to release it one day.

FloGo3308 commented 2 years ago

Oh, my idea was just to direct message(dm) you on discord instead of through a discord server.

FloGo3308 commented 2 years ago

I found a fix! See https://github.com/adepierre/Botcraft/pull/86.

EDIT: This makes it so that it compiles when using this, I havent tested it with the settings i want.

SECOND EDIT: The fix only works with the encryption and compression DISABLED, when I enable both it gives more errors, ill send them as soon as i can(tomorrow).

FloGo3308 commented 2 years ago

I used the following patch to fix the errors when building without encryption.

Index: botcraft/CMakeLists.txt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/botcraft/CMakeLists.txt b/botcraft/CMakeLists.txt
--- a/botcraft/CMakeLists.txt   (revision c04e35e96b86ada1ac42910ce88041e53deea6bc)
+++ b/botcraft/CMakeLists.txt   (date 1653310580469)
@@ -521,6 +521,9 @@

 # Add Asio
 target_link_libraries(botcraft PRIVATE asio)
+if (WIN32)
+    target_link_libraries(botcraft PRIVATE wsock32 ws2_32) # Stop asio from crying on windows about socket stuff not being defined
+endif()
 target_compile_definitions(botcraft PRIVATE ASIO_STANDALONE)

 # Add threads support

Building with encryption is still broken, but first I gotta fix a bigger problem; running the program... As soon as I run the program it exits with code 0xc0000135 and says nothing, but when I run the program normaly using my terminal instead of the clion run thing it complains about not being able to find 3 libraries, including libbotcraft_d.dll, which does actualy excist, but just in a diffrent folder. libbotcraft_d.dll is in bin/ while my executable is built to cmake-build-debug/ (which is a custom build folder made by clion). Do you have any idea what I could do to make it work? image

adepierre commented 2 years ago

For the patch, I guess I could integrate for people using mingw. I'll have to perform more test though to make sure it doesn't break things with msvc compiler.

For the misplaced exe file, this is very strange, as here we specifically ask the project to output the library in the bin folder and here for the example exe. So if one is out of place, the other one should be too.

FloGo3308 commented 2 years ago

... and here for the example exe. So ...

Wait I dont have that part in my cmake file, ill add it and try again

if(MSVC)
    # To avoid having folder for each configuration when building with Visual
    set_target_properties(0_HelloWorld PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/bin")
    set_target_properties(0_HelloWorld PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/bin")
    set_target_properties(0_HelloWorld PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_SOURCE_DIR}/bin")
    set_target_properties(0_HelloWorld PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_SOURCE_DIR}/bin")

    set_property(TARGET 0_HelloWorld PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
else()
    set_target_properties(0_HelloWorld PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
endif(MSVC)
adepierre commented 2 years ago

Ah yes I thought you were trying to compile the examples. Forgot ou had your own project. So yes it's definitely the issue for the non found dll. Botcraft sets output folder in the cmake instead of using default locations so you'll need to either output your exe at the same place or copy the dll next to your exe.

FloGo3308 commented 2 years ago

My weird patch is a stupid way of solving my problems. I saw this stackoverflow question about exact the same error, and it seems that this line in your code does not do what it is supposed to do. Could you take a look at the stackoverflow question and compare it with your (broken?) fix?

adepierre commented 2 years ago

I am not sure what you are refering to as your patch and my fix, but I'll try to answer based on what I think I've understood.

So basically to use asio without boost, you need to have the ASIO_STANDALONE compile option set whenever you compile a target depending on asio. You have two ways to define this: when creating the asio interface library (last part of the stack overflow answer) or directly for the compilation of the library linked against asio. As asio is header only and thus not compiled, in both cases, the result is the same: during the compilation of the library depending on asio, ASIO_STANDALONE will be defined. The main difference is that in the first case, all libraries depending on asio in your project will be forced to use ASIO_STANDALONE, while in the second one, you can control it per library (here only botcraft depends on asio so there is no real difference, but if one day someone wants to use both botcraft and asio with boost for another library, they will be able to do it).

I can confirm this line is asking cmake to do exactly what it is supposed to do: adding the variable when compiling the botcraft target/library.

Another difference with the SO question is that the use of PUBLIC/PRIVATE in the definition. In botcraft, all the calls to asio methods are done in headers that are hidden after compilation (them). That means that once botcraft is built, you only have link your exe project with botcraft, and not asio (or openssl with the same trick).

I hope it gives you some partial answers.

PS : I'll be away from home for the next few days, so my ability to test stuff and help will probably be reduced, sorry

FloGo3308 commented 2 years ago

I am honestly out of ideas on how this could be fixed. The only thing I think could be the fault is that asio somehow doesnt know that the ASIO_STANDALONE is set, even though this should do the job. For now I will just give up and shove everything into a docker container.

If someone had the same problem as me and has figgured out a way to fix it: please let me know!

adepierre commented 2 years ago

Could you remind me of what "this" is exactly? You've mentionned multiple issues in this thread and I'm not sure which one you refer to.

The easiest way to know if ASIO_STANDALONE is defined would be to check the command line used to compiled the botcraft target.

With Visual Studio I know I can right click a project and get this information, and it's easy to see ASIO_STANDALONE is set. Unfortunately I don't know how to do a similar thing with your setup.

/GS /W3 /Zc:wchar_t /I"path\to\Botcraft\botcraft\include" /I"path\to\Botcraft\build\botcraft\include" /I"path\to\Botcraft\botcraft\private_include" /I"path\to\Botcraft\3rdparty\json\include" /I"path\to\Botcraft\protocolCraft\include" /I"path\to\Botcraft\3rdparty\asio\asio\include" /I"path\to\Botcraft\build\3rdparty\glfw\install\include" /I"path\to\Botcraft\build\3rdparty\glad\install\include" /I"path\to\Botcraft\3rdparty\glm" /I"path\to\Botcraft\3rdparty\rectpack2D\src" /I"path\to\Botcraft\3rdparty\stb_image\include" /I"F:\Anaconda\Library\include" /Zi /Gm- /O2 /Ob1 /Fd"botcraft.dir\RelWithDebInfo\vc142.pdb" /Zc:inline /fp:precise /D "_WINDLL" /D "_MBCS" /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "ASSETS_PATH=\"./Assets/1.18.1\"" /D "ASIO_STANDALONE" /D "USE_GUI=1" /D "USE_COMPRESSION=1" /D "USE_ENCRYPTION=1" /D "PROTOCOL_VERSION=757" /D "CMAKE_INTDIR=\"RelWithDebInfo\"" /D "botcraft_EXPORTS" /errorReport:prompt /WX- /Zc:forScope /GR /Gd /MD /std:c++17 /Fa"botcraft.dir\RelWithDebInfo\" /EHsc /nologo /Fo"botcraft.dir\RelWithDebInfo\" /Fp"botcraft.dir\RelWithDebInfo\botcraft_rd.pch" /diagnostics:column 
adepierre commented 2 years ago

Any news about this? Did you find anything that could help tracking down the issue?

I'm now back and I'd like to setup the same compilation environment you did to reproduce the issue. Could you give me a detailed description of what you installed (clion, compilation etc...) and how you compiled botcraft using this setup? I don't know anything about clion or how it works so the more details you can give me the easier I can reproduce the issue and see how to fix it.

adepierre commented 2 years ago

@FloGo3308 I've been able to download CLion and reproduce your error. I just pushed some changes to the cmake build system that allowed me to correctly compile and then run the examples. Could you confirm me the latest version of the code also works for you? Thanks

FloGo3308 commented 2 years ago

That sounds great! Ill try as soon as i can

FloGo3308 commented 2 years ago

More problems :(

I think they may be 1.12.2-only bugs.

my current CMakeFile(1.12.2 with compression and encryption still disabled):

cmake_minimum_required(VERSION 3.22)
project(czeropthreebot)

set(CMAKE_CXX_STANDARD 17)

add_executable(czeropthreebot src/main.cpp)

#set_property(TARGET czeropthreebot PROPERTY CXX_STANDARD 11)
#target_compile_options(czeropthreebot PRIVATE -Wall)

cmake_policy(SET CMP0077 NEW)
set(BOTCRAFT_COMPRESSION OFF CACHE BOOL "" FORCE)
set(BOTCRAFT_ENCRYPTION OFF CACHE BOOL "" FORCE)
set(GAME_VERSION 1.12.2 CACHE STRING "" FORCE)

add_subdirectory(lib/botcraft EXCLUDE_FROM_ALL)
target_link_libraries(czeropthreebot PRIVATE botcraft)

set_target_properties(czeropthreebot PROPERTIES DEBUG_POSTFIX "_d")
set_target_properties(czeropthreebot PROPERTIES RELWITHDEBINFO_POSTFIX "_rd")

if(MSVC)
    # To avoid having folder for each configuration when building with Visual
    set_target_properties(czeropthreebot PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_SOURCE_DIR}/bin")
    set_target_properties(czeropthreebot PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_SOURCE_DIR}/bin")
    set_target_properties(czeropthreebot PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO "${CMAKE_SOURCE_DIR}/bin")
    set_target_properties(czeropthreebot PROPERTIES RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_SOURCE_DIR}/bin")

    set_property(TARGET czeropthreebot PROPERTY VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
else()
    set_target_properties(czeropthreebot PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
endif(MSVC)

The errors when running:

====================[ Build | czeropthreebot | Debug ]==========================
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5921.27\bin\cmake\win\bin\cmake.exe --build D:\czeropthreebot\cmake-build-debug --target czeropthreebot -j 6
[1/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/CommandNode/BrigadierProperty.cpp.obj
[2/204] Building CXX object CMakeFiles/czeropthreebot.dir/src/main.cpp.obj
[3/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/NBT/TagLongArray.cpp.obj
[4/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/NBT/TagIntArray.cpp.obj
[5/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/BlockMarkerParticle.cpp.obj
[6/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/Particle.cpp.obj
[7/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/DustParticle.cpp.obj
[8/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/NBT/TagList.cpp.obj
[9/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/BlockParticle.cpp.obj
[10/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/DustColorTransitionParticle.cpp.obj
[11/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/NBT/TagCompound.cpp.obj
[12/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/VibrationParticle.cpp.obj
[13/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Vibrations/PositionSource.cpp.obj
[14/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/ItemParticle.cpp.obj
[15/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Recipes/RecipeTypeData.cpp.obj
[16/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/BaseMessage.cpp.obj
FAILED: lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/BaseMessage.cpp.obj 
C:\Users\keesg\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\221.5921.27\bin\mingw\bin\g++.exe -DPROTOCOL_VERSION=340 -ID:/czeropthreebot/lib/botcraft/protocolCraft/include -ID:/czeropthreebot/lib/botcraft/3rdparty/json/include -g -std=gnu++11 -MD -MT lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/BaseMessage.cpp.obj -MF lib\botcraft\protocolCraft\CMakeFiles\protocolCraft.dir\src\BaseMessage.cpp.obj.d -o lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/BaseMessage.cpp.obj -c D:/czeropthreebot/lib/botcraft/protocolCraft/src/BaseMessage.cpp
In file included from D:/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Messages/Play/Serverbound/ServerboundContainerClickPacket.hpp:4,
                 from D:/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/AllMessages.hpp:42,
                 from D:/czeropthreebot/lib/botcraft/protocolCraft/src/BaseMessage.cpp:2:
D:/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp: In member function 'const bool ProtocolCraft::Slot::SameItem(const ProtocolCraft::Slot&) const':
D:/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:20: error: 'item_id' was not declared in this scope
   50 |             return item_id == s.GetItemID();
      |                    ^~~~~~~
D:/czeropthreebot/lib/botcraft/protocolCraft/include/protocolCraft/Types/Slot.hpp:50:33: error: 'const class ProtocolCraft::Slot' has no member named 'GetItemID'
   50 |             return item_id == s.GetItemID();
      |                                 ^~~~~~~~~
[17/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/NoDataTypedParticle.cpp.obj
[18/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/BlockcrackParticle.cpp.obj
[19/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/BlockdustParticle.cpp.obj
[20/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/FallingDustParticle.cpp.obj
[21/204] Building CXX object lib/botcraft/protocolCraft/CMakeFiles/protocolCraft.dir/src/Types/Particles/IconcrackParticle.cpp.obj
ninja: build stopped: subcommand failed.
adepierre commented 2 years ago

Are you sure you're running with the latest version of the code? As I fixed a bug for 1.12.2 last month exactly at this point in the code (see this commit).

If you do have a version with the fix, it means your configuration is wrong, as the line showed in your logs (return item_id == s.GetItemID();) should not be compiled for 1.12.2, as PROTOCOL_VERSION should be 340, i.e. < 350.

adepierre commented 2 years ago

Any news on your side regarding this issue?

adepierre commented 2 years ago

Closing as no response, feel free to reopen if it still doesn't work for you.

FloGo3308 commented 1 year ago

Completely forgot about this issue... I have switched from windows to linux(not because of this problem, just because I like linux) and everything seems to work without any problems, so I guess I can mark this issue as resolved?