Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use uWebsockets via vcpkg #1811

Open
abhinavdhamaniya-jm opened this issue Nov 19, 2024 · 1 comment
Open

Unable to use uWebsockets via vcpkg #1811

abhinavdhamaniya-jm opened this issue Nov 19, 2024 · 1 comment

Comments

@abhinavdhamaniya-jm
Copy link

abhinavdhamaniya-jm commented Nov 19, 2024

This issue might be similar to https://github.com/uNetworking/uWebSockets/issues/1545

I am using vcpkg to download the uWebSockets library, here are the steps i followed -

  1. Added uwebsockets under "dependencies" in vcpkg.json and ran ./vcpkg install --feature-flags=manifests
{
  "name": "test",
  "version-string": "1.0.0",
  "dependencies": [
    "uwebsockets",
    "zlib"
  ]
}
  1. Updated my CMakeLists.txt
find_path(UWEBSOCKETS_INCLUDE_DIRS "uwebsockets/App.h" PATHS "${CMAKE_SOURCE_DIR}/vcpkg_installed/x64-windows/include/")
target_include_directories(juno-mt5-backend
        PRIVATE ${UWEBSOCKETS_INCLUDE_DIRS}
)
  1. Added a sample code

#include <string>
#include <uWebSockets/App.h>


struct TickData {
    std::string symbol;
    double bid;
    double ask;
    long timestamp;
};

int main() {

    uWS::App().get("/hello", [](auto *res, auto *req) {
        res->end("Hello World!");
    });
    
    return 0;
}

And when i run the main() function with this code, i see many errors like this in the console -

main.cpp.obj : error LNK2019: unresolved external symbol us_socket_context_on_end referenced in function "private: struct uWS::HttpContext<0> * __cdecl uWS::HttpContext<0>::init(void)" (?init@?$HttpContext@$0A@@uWS@@AEAAPEAU12@XZ)

So is it because the uWebSocket currently broken in vcpkg or i am doing something wrong?
Is there a version mismatch between uWebSockets and uSockets?

@abhinavdhamaniya-jm
Copy link
Author

@uNetworkingAB can you check this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant