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

How to use mvfst in my project #312

Closed
HaseebLUMS opened this issue Sep 5, 2023 · 2 comments
Closed

How to use mvfst in my project #312

HaseebLUMS opened this issue Sep 5, 2023 · 2 comments

Comments

@HaseebLUMS
Copy link

Hi,

A newbie question. I have built mvfst using the recommended method of running getdeps.sh. Now I see that all the binaries are in _build/mvfst/lib. How do I compile my own project that uses the mvfst as a library? Is there any example cmake file that I can use?

@HaseebLUMS
Copy link
Author

HaseebLUMS commented Sep 6, 2023

While using cmake to use mvfst in my project, I get the following error during making:

ld: library not found for -lgflags_shared
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am not able to work around it.

Following is my CMakeLists.txt

cmake_minimum_required(VERSION 3.15)
project(testing)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
${CMAKE_MODULE_PATH})
find_package(mvfst REQUIRED)
add_executable(${PROJECT_NAME} hello.cpp)
target_link_libraries(${PROJECT_NAME} mvfst::mvfst_client)

@HaseebLUMS
Copy link
Author

HaseebLUMS commented Sep 6, 2023

turns out i just had to include some find_package commands in my CMakeLists.txt

Here are all of my find_package commands in case some newbie like me would wanna know:

find_package(fizz CONFIG REQUIRED)
find_package(folly CONFIG REQUIRED)
find_package(gflags CONFIG REQUIRED)
find_package(gtest CONFIG REQUIRED)
find_package(mvfst REQUIRED)

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