#includes error

368 messages · Page 1 of 1 (latest)

hexed isle
#

how can i fix this problem ?

In included file: 'google/protobuf/runtime_version.h' file not found (clang pp_file_not_found)

delicate sealBOT
#

When your question is answered use !solved or the button below to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

hexed isle
#

this picture is from another editor (vscode)

#

btw the platform is windows

karmic viper
#

What build system, cmake?

hexed isle
#

Been stuck for hours nooo

#

this is the current full code

#include <iomanip> // for std::setw, std::setfill
#include <vector>
#include <cstdint>
#include <winsock2.h>
#include <ws2tcpip.h>
#include "agar_v26.pb.h"
#include <iostream>
#pragma comment(lib, "ws2_32.lib")

const int ListenPORT = 9000;


void ReadExactly(SOCKET ClientSocket, std::vector<char>& buffer, int size) {
    int bytesRead = 0;
    while (bytesRead < size) {

        int result = recv(ClientSocket, buffer.data() + bytesRead, size - bytesRead, 0);
        if (result == SOCKET_ERROR) {
            std::cerr << "recv failed: " << WSAGetLastError() << std::endl;
            closesocket(ClientSocket);
            WSACleanup();
            exit(1);
        }
        if (result == 0) {
            std::cerr << "Connection closed by peer" << std::endl;
            closesocket(ClientSocket);
            WSACleanup();
            exit(1);
        }
        bytesRead += result;
    }
}

void handleClient(SOCKET ClientSocket) {
    std::vector<char> lenBuf(4);
    std::vector<char> buffer;
    while (true){
        ReadExactly(ClientSocket, lenBuf, 4);
        uint32_t netLength;
        memcpy(&netLength, lenBuf.data(), 4);
        uint32_t length = ntohl(netLength);

        buffer.resize(length);
        ReadExactly(ClientSocket, buffer, length);


        std::cout << "Received message (" << buffer.size() << " bytes): ";
        for (unsigned char c : buffer) {
            std::cout << std::hex << std::uppercase
                      << std::setw(2) << std::setfill('0')
                      << static_cast<int>(c) << " ";
        }
        std::cout << std::dec << std::endl; // reset to decimal

        buffer.clear();
    }
}

int main() {
    WSADATA wsaData;
    int iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
    if (iResult != 0) {
        std::cerr << "WSAStartup failed: " << iResult << std::endl;
        return 1;
    }
    std::cout << "WSAStartup successful" << std::endl;
    SOCKET ListenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if (ListenSocket == INVALID_SOCKET) {
        std::cerr << "socket failed: " << WSAGetLastError() << std::endl;
        WSACleanup();
        return 1;
    }
    std::cout << "Listening Socket Created Successfully" << std::endl;
    sockaddr_in ListenAddr;
    ListenAddr.sin_family = AF_INET;
    ListenAddr.sin_port = htons(ListenPORT);
    ListenAddr.sin_addr.s_addr = htonl(INADDR_ANY);

    if (bind(ListenSocket, (sockaddr*)&ListenAddr, sizeof(ListenAddr)) == SOCKET_ERROR) {
        std::cerr << "Bind failed\n";
        closesocket(ListenSocket);
        WSACleanup();
        return 1;
    }
    std::cout << "Bind Successful" << std::endl;
    if (listen(ListenSocket, SOMAXCONN) == SOCKET_ERROR) {
        std::cerr << "Listen failed\n";
        closesocket(ListenSocket);
        WSACleanup();
        return 1;
    }
    std::cout << "Listening on port " << ListenPORT << std::endl;
    while (true) {
        SOCKET ClientSocket = accept(ListenSocket, NULL, NULL);
        if (ClientSocket == INVALID_SOCKET) {
            std::cerr << "Accept failed: " << WSAGetLastError() << std::endl;
            closesocket(ListenSocket);
            WSACleanup();
            return 1;
        }
        std::cout << "Connection accepted" << std::endl;

        handleClient(ClientSocket);
    }

    return 0;
}
#

i got clang++ and g++ tho

#

should i give compile commands content ?

karmic viper
#

Did you write it by hand?

hexed isle
#
[
  {
    "directory": "C:/Users/spn/Desktop/C&C++",
    "command": "clang++ ps.cpp agar_v26.pb.cc -o ps.exe --target=x86_64-w64-windows-gnu --sysroot=C:/msys64/mingw64 -std=c++20 -I. -IC:/protoc-28.0-rc-2-win64/include -LC:/protoc-28.0-rc-2-win64/lib -lprotobuf -static",
    "file": "ps.cpp"
  }
]
#

i tried even using gpt

#

still didnt work

karmic viper
hexed isle
#

well one thing i noticed

#

dont have
-IC:/protoc-28.0-rc-2-win64/include -LC:/protoc-28.0-rc-2-win64/lib
.cc .h files

#

hold up i think im cooking

hexed isle
#

im cooked

#

yo i found the pkgs but idk how to include them

@karmic viper

karmic viper
#

Wait, does this program compile for you at all? When you compile it in the terminal

#

And if so, what compiler command do you use?

hexed isle
#
PS C:\Users\spn\Desktop\C&C++> clang++ ps.cpp -o ps -lws2_32  ;./ps
In file included from ps.cpp:6:
./agar_v26.pb.h:14:10: fatal error: 'google/protobuf/runtime_version.h' file not found
   14 | #include "google/protobuf/runtime_version.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
WSAStartup successful
Listening Socket Created Successfully
Bind Successful
Listening on port 9000
hexed isle
#

imma try install cmake and run it over cmake list in the folder i have

karmic viper
#

Make it compile in the terminal first, and then start fixing the red squiggles

hexed isle
#

i fixed it by just running cmake and doing extra stuff ..... but at what cost

#

somehow my paths got wiped 💀💀💀💀

karmic viper
#

Paths?

hexed isle
karmic viper
#

Yeah this doens't look good

hexed isle
#

damn shit still cooked asf

#

doesnt compile

#

wtf

#

displaying errors for 5 mins

hexed isle
#

mr dippy @karmic viper

#

well basically idk if u all ever used protobuf

#

but in cpp what seems to u gotta compiler the whole project which will give you something called protoc and includes files

#

thats what i concluded

hard quiver
hexed isle
#

and then link the includes to ur project

hexed isle
#

same for games

#

well for now i tried compiling the protobuf with cmake

#

they said i should do it in readme

#

i get this

#

which seems to be just absl libraray missing

hallow imp
# hexed isle

I've managed to link to protobuf without any issue.

hexed isle
hallow imp
#

without zlib, without absl provider

hallow imp
#

so my question

#

what are you trying to do precisely

hexed isle
hexed isle
#

they use protobuf

#

i need protobuf to be able to marshal and unmarshal msgs

hard quiver
#

im doing it on windows rn

#

wait a sec :)

#

my cpu burning rn

hexed isle
#

btw

#

when i do cmake

hallow imp
hexed isle
hexed isle
#

tcp server

#

well

#

i didnt even bulid 5% of full thing yet lol

#

btw im beginner, i used to use go and python but i got nice knowledge of low level

#

this the current code if u want to see

hard quiver
hexed isle
#
#include <iomanip>
#include <vector>
#include <cstdint>
#include <winsock2.h>
#include <ws2tcpip.h>
#include "agar_v26.pb.h"
#include <iostream>
#pragma comment(lib, "ws2_32.lib")

const int ListenPORT = 9000;


void ReadExactly(SOCKET ClientSocket, std::vector<char>& buffer, int size) {
    int bytesRead = 0;
    while (bytesRead < size) {

        int result = recv(ClientSocket, buffer.data() + bytesRead, size - bytesRead, 0);
        if (result == SOCKET_ERROR) {
            std::cerr << "recv failed: " << WSAGetLastError() << std::endl;
            closesocket(ClientSocket);
            WSACleanup();
            exit(1);
        }
        if (result == 0) {
            std::cerr << "Connection closed by peer" << std::endl;
            closesocket(ClientSocket);
            WSACleanup();
            exit(1);
        }
        bytesRead += result;
    }
}



void handleClient(SOCKET ClientSocket) {
    std::vector<char> lenBuf(4);
    std::vector<char> buffer;
    while (true){
        ReadExactly(ClientSocket, lenBuf, 4);
        uint32_t netLength;
        memcpy(&netLength, lenBuf.data(), 4);
        uint32_t length = ntohl(netLength);

        buffer.resize(length);
        ReadExactly(ClientSocket, buffer, length);

        std::cout << "Received message (" << buffer.size() << " bytes): ";
        for (unsigned char c : buffer) {
            std::cout << std::hex << std::uppercase
                      << std::setw(2) << std::setfill('0')
                      << static_cast<int>(c) << " ";
        }
        std::cout << std::dec << std::endl; // reset to decimal
        agario::proto::envelope envelope;

        envelope.ParseFromArray(buffer.data(), buffer.size());
        std::cout << envelope.DebugString();


        buffer.clear();
    }
}

int main() {
    WSADATA wsaData;
    int iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);
    if (iResult != 0) {
        std::cerr << "WSAStartup failed: " << iResult << std::endl;
        return 1;
    }
    std::cout << "WSAStartup successful" << std::endl;
    SOCKET ListenSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
    if (ListenSocket == INVALID_SOCKET) {
        std::cerr << "socket failed: " << WSAGetLastError() << std::endl;
        WSACleanup();
        return 1;
    }
    std::cout << "Listening Socket Created Successfully" << std::endl;
    sockaddr_in ListenAddr;
    ListenAddr.sin_family = AF_INET;
    ListenAddr.sin_port = htons(ListenPORT);
    ListenAddr.sin_addr.s_addr = htonl(INADDR_ANY);

    if (bind(ListenSocket, (sockaddr*)&ListenAddr, sizeof(ListenAddr)) == SOCKET_ERROR) {
        std::cerr << "Bind failed\n";
        closesocket(ListenSocket);
        WSACleanup();
        return 1;
    }
    std::cout << "Bind Successful" << std::endl;
    if (listen(ListenSocket, SOMAXCONN) == SOCKET_ERROR) {
        std::cerr << "Listen failed\n";
        closesocket(ListenSocket);
        WSACleanup();
        return 1;
    }
    std::cout << "Listening on port " << ListenPORT << std::endl;
    while (true) {
        SOCKET ClientSocket = accept(ListenSocket, NULL, NULL);
        if (ClientSocket == INVALID_SOCKET) {
            std::cerr << "Accept failed: " << WSAGetLastError() << std::endl;
            closesocket(ListenSocket);
            WSACleanup();
            return 1;
        }
        std::cout << "Connection accepted" << std::endl;

        handleClient(ClientSocket);
    }

    return 0;
}
hard quiver
#

you can use winget

hexed isle
#

actually nvm

#

i didnt try check if i will get includes error aswell

hard quiver
#
CPMAddPackage("gh:protocolbuffers/[email protected]")
target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf)

it took 2 lines for me to link 🤔

#

ill see if i can include the file ur missing

hallow imp
#

took a bit more with FetchContent


include(FetchContent)

FetchContent_Declare(
    protobuf
    GIT_REPOSITORY https://github.com/protocolbuffers/protobuf.git
    GIT_TAG        v33.0
    # Faster fetch; comment these two lines if you need full history/submodules
    GIT_SHALLOW    TRUE
    SOURCE_SUBDIR  cmake
)

set(protobuf_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(protobuf_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(protobuf_WITH_ZLIB OFF CACHE BOOL "" FORCE)
set(protobuf_ABSL_PROVIDER OFF CACHE STRING "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

if(PROTOBUF_ABSL_PROVIDER STREQUAL "package")
    find_package(absl QUIET)
endif()

FetchContent_MakeAvailable(protobuf)

set(Protobuf_FOUND TRUE)
hexed isle
#

You can install the protocol compiler, protoc, with a package manager under Linux, macOS, or Windows using the following commands.

this will just get compiler i assume

hard quiver
#

hmm could be

hexed isle
#

i mean u can just download the compiler by itself

#

but they say cpp must build it

#

so u get the includes aswell

#

so what should i do sgr

#

someone told me , just use rust/zig

#

🤣

hard quiver
#
include(cmake/CPM.cmake)

find_package(Catch2 3)
set(protobuf_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(protobuf_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
set(protobuf_WITH_ZLIB OFF CACHE BOOL "" FORCE)
set(protobuf_ABSL_PROVIDER OFF CACHE STRING "" FORCE)
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

CPMAddPackage("gh:protocolbuffers/[email protected]")
target_link_libraries(${PROJECT_NAME} PRIVATE protobuf::libprotobuf)
#

use CPM

#

works for me

hexed isle
#

what is cpm?

#

sorry for being noob

hard quiver
#

basically a way to do one liner build from source stuff

hard quiver
#

its not a good option for big team projects but for "just make it work" solutions, its good

#

basically i tell it to download and build the source from github

hexed isle
#

meh im not elon mask

#

space x

#

well any links ?

karmic viper
#

So did Laci's suggestion work?

karmic viper
hexed isle
hexed isle
karmic viper
#

Ah I see

hexed isle
#

just when im hopeless

hexed isle
hard quiver
#

and include it in cmake

hexed isle
hard quiver
#

just make a cmake directory in your project

#

and put CPM.cmake there

#

and include(cmake/CPM.cmake)

#

its just a cmake script that does stuff for you

hexed isle
#

🤣

hard quiver
#

not in your cpp source files

#

wait are you not using cmake sus

hexed isle
#

im not, idk im always editing the json file

hard quiver
#

use cmake 👍

hexed isle
#

found someone doing this on google

hard quiver
#

or what editor is that

#

xd

hexed isle
#

vscode is bloaty

hard quiver
#

cring use a real ide

hard quiver
hexed isle
#

i mean i got vscode

#

i used it before zed

hard quiver
#

with good cmake integration

hexed isle
hard quiver
#

i use it for all c++ stuff

hard quiver
#

its free

#

👍

#

heavyweight, but good

hexed isle
#

intresting, would it spoonfed me

#

fixing problems like rn /

hexed isle
#

that seems very promising....

hexed isle
#

bro im gonna cry

#

still trying fix the problem like see this

#

g++ ps.cpp agar_v26.pb.cc -o ps.exe -std=c++20 -IC:/Users/spn/Desktop/install/include -IC:/Users/spn/Desktop/absl-install/include -LC:/Users/spn/Desktop/install/lib -LC:/Users/spn/Desktop/absl-install/lib -lprotobuf -labsl_synchronization -labsl_base -labsl_raw_logging_internal -labsl_malloc_internal -labsl_spinlock_wait -lws2_32 -lstdc++ -static

karmic viper
#

This command is from the cmake log, right?

#

I recommend dropping all those custom -I and -L flags and installing those libraries in MSYS2

hexed isle
#

my eyes shutting

#

working since 4 am

#

12 hours straight

#

no avail

#

at this poin

#

t

#

im gonna try pay someone to do it no jokes

#

actually

#

should i just try link it on unix based system

karmic viper
hexed isle
karmic viper
#

But like, weren't you using cmake before?

hexed isle
karmic viper
hexed isle
karmic viper
hexed isle
#

i did

karmic viper
#

Type pacman -Qe in MSYS2 and send the output

#

And also type gcm g++ in whatever terminal you're compiling from (not msys2 I assume?)

hexed isle
karmic viper
#

Do you want to use g++ or clang++ ? I saw you use clang before, but now you're using gcc

hexed isle
hexed isle
#

should i get rid of one of them

#

i assume clang

karmic viper
#

No, keeping both is fine

hexed isle
karmic viper
#

Does your program need abseil?

hexed isle
#

yeah

karmic viper
#

pacman -S mingw-w64-x86_64-abseil-cpp

hexed isle
#

i did on my desktop and cmake it but lets see on msys2

#

ok installed

#

what now

karmic viper
#

Now just g++ ps.cpp agar_v26.pb.cc -o ps.exe -std=c++20 -lprotobuf -labsl_synchronization -labsl_base -labsl_raw_logging_internal -labsl_malloc_internal -labsl_spinlock_wait -lws2_32

#

This is your command, but I removed all -I, -L, and -static too for now

#

If this doesn't work, send the first ~10 errors

#

So?

hexed isle
#

sorry

#

i had to dip

hexed isle
#
labsl_malloc_internal -labsl_spinlock_wait -lws2_32
In file included from ps.cpp:6:
agar_v26.pb.h:16:2: error: #error "Protobuf C++ gencode is built with an incompatible version of"
   16 | #error "Protobuf C++ gencode is built with an incompatible version of"
      |  ^~~~~
agar_v26.pb.h:17:2: error: #error "Protobuf C++ headers/runtime. See"
   17 | #error "Protobuf C++ headers/runtime. See"
      |  ^~~~~
agar_v26.pb.h:18:2: error: #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
   18 | #error "https://protobuf.dev/support/cross-version-runtime-guarantee/#cpp"
      |  ^~~~~
#

lemme try edit so it uses the protobuf i compiled in desktop

#

g++ ps.cpp agar_v26.pb.cc -o ps.exe -std=c++20 -lC:\Users\spn\Desktop\install\include -labsl_synchronization -labsl_base -labsl_raw_logging_internal -labsl_malloc_internal -labsl_spinlock_wait -lws2_32

#

still cooked

#

but its Protobuf C++ gencode is built with an incompatible version of

#

btw im not running in msys

karmic viper
karmic viper
hexed isle
#

..

hexed isle
karmic viper
#

Uhh, you mean protoc?

#

I never used it, is this you generate the headers?

#

You should be able to directly run it from your terminal. It's at C:\msys64\bin\protoc.exe, but this is the same location where you have g++.exe, and since you can run that directly, you should be able to run protoc directly too

hexed isle
#

nuh uh

karmic viper
#

Ah sorry, C:\msys64\mingw64\bin\protoc.exe

karmic viper
#

You can confirm this by adding -H, it'll dump all headers it includes

hexed isle
karmic viper
hexed isle
#

but they need the includes

karmic viper
#

Ok, but what does this have to do with my question

hexed isle
karmic viper
#

Good

hexed isle
#

no

#

but im back at the many errors

karmic viper
#

Can you run gcm protoc? I'm curious

karmic viper
#

Can you show the first ~10 errors again?

hexed isle
karmic viper
#

Ok, let's try pacman -S mingw-w64-x86_64-lld, and then build with clang++ -fuse-ld=lld instead of g++

hexed isle
karmic viper
karmic viper
#

Then both protoc and C:\msys64\mingw64\bin\protoc.exe should do the same thing. But I guess this doesn't really matter

hexed isle
#

fr thats weird

#

what i do with clang++ -fuse-ld=lld?

karmic viper
#

Same command as you used before, but replace g++ with clang++ -fuse-ld=lld

hexed isle
#

alright

karmic viper
#

Clang with LLD isn't sensitive to the order of the -l flags, unlike GCC. If this works, this'll mean that the order is wrong

hexed isle
#

well

#

its absl again

karmic viper
#

Okay, let's get rid of -lprotobuf -labsl_synchronization -labsl_base -labsl_raw_logging_internal -labsl_malloc_internal -labsl_spinlock_wait -lws2_32 and get all the flags from pkg-config

#

Install pacman -S mingw-w64-x86_64-pkgconf

hexed isle
#

i feel we are cooking

karmic viper
#

🙂

#

Try running pkg-config --libs --cflags absl_log, what does it print?

hexed isle
#

i was trying randomly for 3 days lmao

#

spn@DESKTOP-VEKLTVB MINGW64 ~
$ pkg-config --libs --cflags absl_log
-DNOMINMAX -labsl_log_internal_conditions -labsl_log_internal_message -labsl_examine_stack -labsl_lo
g_internal_format -labsl_str_format_internal -labsl_log_internal_nullguard -labsl_log_internal_struc
tured_proto -labsl_log_internal_proto -labsl_log_internal_log_sink_set -labsl_log_internal_globals -
labsl_log_globals -labsl_hash -labsl_city -labsl_low_level_hash -labsl_log_sink -labsl_strerror -lab
sl_vlog_config_internal -labsl_log_internal_fnmatch -labsl_synchronization -labsl_graphcycles_intern
al -labsl_kernel_timeout_internal -labsl_stacktrace -labsl_symbolize -ldbghelp -labsl_debugging_inte
rnal -labsl_demangle_internal -labsl_demangle_rust -labsl_decode_rust_punycode -labsl_utf8_for_code_
point -labsl_malloc_internal -labsl_time -labsl_civil_time -labsl_time_zone -labsl_tracing_internal
-labsl_strings -labsl_strings_internal -labsl_string_view -labsl_int128 -labsl_base -ladvapi32 -labs
l_spinlock_wait -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity

spn@DESKTOP-VEKLTVB MINGW64 ~

#

should this command work outside msys

#

maybe i should try compile inside msys ?

karmic viper
#

Everything that you install via pacman -S mingw-w64-x86_64-... gets installed to C:\msys64\mingw64. And since you apparently have C:\msys64\mingw64\bin in the PATH, no surprise that it works

karmic viper
hexed isle
karmic viper
#

When they do, it's usually a skill issue 😛

hexed isle
karmic viper
#

Yes

hexed isle
#

lmao

karmic viper
#

In general, you should try to get all your library-specific flags from pkg-config instead of trying to guess them yourself

hexed isle
#

clang++ -fuse-ld=lld ps.cpp agar_v26.pb.cc -o ps.exe -std=c++20 -lprotobuf -lws2_32

#

lemme add rn

#

clang++ -fuse-ld=lld ps.cpp agar_v26.pb.cc -o ps.exe -std=c++20 -lprotobuf -lws2_32 -labsl_log_internal_conditions -labsl_log_internal_message -labsl_examine_stack -labsl_lo g_internal_format -labsl_str_format_internal -labsl_log_internal_nullguard -labsl_log_internal_struc tured_proto -labsl_log_internal_proto -labsl_log_internal_log_sink_set -labsl_log_internal_globals - labsl_log_globals -labsl_hash -labsl_city -labsl_low_level_hash -labsl_log_sink -labsl_strerror -lab sl_vlog_config_internal -labsl_log_internal_fnmatch -labsl_synchronization -labsl_graphcycles_intern al -labsl_kernel_timeout_internal -labsl_stacktrace -labsl_symbolize -ldbghelp -labsl_debugging_inte rnal -labsl_demangle_internal -labsl_demangle_rust -labsl_decode_rust_punycode -labsl_utf8_for_code_ point -labsl_malloc_internal -labsl_time -labsl_civil_time -labsl_time_zone -labsl_tracing_internal -labsl_strings -labsl_strings_internal -labsl_string_view -labsl_int128 -labsl_base -ladvapi32 -labs l_spinlock_wait -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity

karmic viper
#

Ok, apparently protobuf works with pkg-config file too. So you can drop -lprotobuf and do pkg-config --libs --cflags absl_log protobuf

hexed isle
#

lmao absl still missing

karmic viper
#

pkg-config --libs --cflags absl_log protobuf absl_check

#

This maybe?

#

FYI instead of copypasting the flags you can do clang++ -fuse-ld=lld ps.cpp agar_v26.pb.cc -o ps.exe -std=c++20 $(pkg-config --libs --cflags absl_log protobuf absl_check)

hexed isle
#

hold up

#

trying to do

hexed isle
#

oo

#

only 2 errors

#
PS C:\Users\spn\Desktop\C&C++> clang++ -fuse-ld=lld ps.cpp agar_v26.pb.cc -o ps.exe -std=c++20 -lws2_32 -lprotobuf -labsl_log_internal_check_op -labsl_di
e_if_null -labsl_log_internal_conditions -labsl_log_internal_message -labsl_examine_stack -labsl_log_internal_format -labsl_log_internal_nullguard -labsl
_log_internal_structured_proto -labsl_log_internal_proto -labsl_log_internal_log_sink_set -labsl_log_sink -labsl_flags_internal -labsl_flags_marshalling
l_flags_program_name -labsl_log_initialize -labsl_log_internal_globals -labsl_log_globals -labsl_vlog_config_internal -labsl_log_internal_fnmatch -labsl_
raw_hash_set -labsl_hash -labsl_city -labsl_low_level_hash -labsl_hashtablez_sampler -labsl_random_distributions -labsl_random_seed_sequences -labsl_rand
om_internal_entropy_pool -labsl_random_internal_randen -labsl_random_internal_randen_hwaes -labsl_random_internal_randen_hwaes_impl -labsl_random_interna
l_randen_slow -labsl_random_internal_platform -labsl_random_internal_seed_material -lbcrypt -labsl_random_seed_gen_exception -labsl_statusor -labsl_statu
s -labsl_cord -labsl_cordz_info -labsl_cord_internal -labsl_cordz_functions -labsl_exponential_biased -labsl_cordz_handle -labsl_crc_cord_state -labsl_cr
c32c -labsl_crc_internal -labsl_crc_cpu_detect -labsl_leak_check -labsl_strerror -labsl_str_format_internal -labsl_synchronization -labsl_graphcycles_int
ernal -labsl_kernel_timeout_internal -labsl_stacktrace -labsl_symbolize -ldbghelp -labsl_debugging_internal -labsl_demangle_internal -labsl_demangle_rust
 -labsl_decode_rust_punycode -labsl_utf8_for_code_point -labsl_malloc_internal -labsl_tracing_internal -labsl_time -labsl_civil_time -labsl_time_zone -lu
tf8_validity -lutf8_range -labsl_strings -labsl_strings_internal -labsl_string_view -labsl_int128 -labsl_base -ladvapi32 -labsl_spinlock_wait -labsl_thro
w_delegate -labsl_raw_logging_internal -labsl_log_severity
ld.lld: error: undefined symbol: __emutls_v._ZN6google8protobuf8internal15ThreadSafeArena13thread_cache_E
>>> referenced by C:/Users/spn/AppData/Local/Temp/agar_v26-47a1f9.o:(.refptr.__emutls_v._ZN6google8protobuf8internal15ThreadSafeArena13thread_cache_E)
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
karmic viper
#

What does gcm clang++ print?

#

It should be C:\msys64\mingw64\bin\clang++.exe, but it's probably not

hexed isle
karmic viper
#

Hah interesting

#

Try replacing clang++ -fuse-ld=lld back with g++

hexed isle
#

yeah just asked gpt

karmic viper
#

I gotta go, will reply later 🙂

hexed isle
#

ye wtf

#

gpt says just rebulid whole shit with g++ again

karmic viper
#

This is super weird

#

Probably just missing something from pkg-config

karmic viper
hexed isle
#
.pb.cc:(.rdata$.refptr.__emutls_v._ZN6google8protobuf8internal15ThreadSafeArena13thread_cache_E[.refptr.__emutls_v._ZN6google8protobuf8internal15ThreadSa
feArena13thread_cache_E]+0x0): undefined reference to `__emutls_v._ZN6google8protobuf8internal15ThreadSafeArena13thread_cache_E'
collect2.exe: error: ld returned 1 exit status
#

lmao nothing on google @karmic viper

karmic viper
#

Try with -DGOOGLE_PROTOBUF_NO_THREADLOCAL

hexed isle
#

okay

#

btw i didnt include those

karmic viper
#

From pkg-config output?

hexed isle
karmic viper
#

If so, try adding them first, and ignore -DGOOGLE_PROTOBUF_NO_THREADLOCAL for now

karmic viper
hexed isle
karmic viper
#

All of them

hexed isle
#

it compiled 💀💀💀💀

hexed isle
#

lemme try run

karmic viper
#

🔥

hexed isle
#

lemme try connect

#

and send packet

hexed isle
karmic viper
#

Btw, you tried static linking before. To do that, both add --static to pkg-config (it'll probably print even more flags), and also pass -static to the compiler

karmic viper
hexed isle
#

if i do -static

#

it wont need dependencies in another machine right

karmic viper
#

Yeah. Or you can just copy dlls next to your executable, and zip them together

hexed isle
#

lemme try just do -static before compiling and see if it compiles

#

then check pkg-config

karmic viper
#

Even if it happens to work now, it's not supposed to work in general

hexed isle
#

ye doesnt compile

#

ok so i did this

#

lemme try copy

#

it compiled with -static flag now 🔥 @karmic viper

#

wait so how to use pkg_config again ?

karmic viper
#

Wdym, you just used it?

hexed isle
#

like what it does is search what dependencies another dependency is using

karmic viper
#

The library names you pass to it, like absl_log and protobuf, correspond to files in C:\msys64\mingw64\lib\pkgconfig

#

So e.g. when you give it absl_log, it loads the flags from the file named absl_log.pc in that directory. Most libraries include those .pc files

hexed isle
#

ah

#

thanks bro i thought i will never solve it nooo

#

well

#

if i wanna include zlib

#

do same steps if i get any error

karmic viper
#

Yeah, same steps should work.

hexed isle
#

pacman -S mingw-w64-x86_64-zlib

#

seems like its already installed

#

if i wanted to include it

#

just do

#

-lzlib ?

karmic viper
#

Run pkg-config --libs --cflags zlib and see what it tells you

hexed isle
#

alr

#

just

#

-lz

#

lol zed and vscode are cooked

#

i think they use clang

delicate sealBOT
#

@hexed isle Has your question been resolved? If so, type !solved :)

hexed isle
#

!solved