Skip to content

Running simple-cache-example gives an error, flag 'v' was defined more than once #309

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

Open
YuqingXiong opened this issue Apr 28, 2024 · 7 comments

Comments

@YuqingXiong
Copy link

YuqingXiong commented Apr 28, 2024

Describe the bug
when i run the example "simple_cache", i find an error "ERROR: flag 'v' was defined more than once"

To Reproduce
Steps to reproduce the behavior:

  1. cd CacheLib/examples/simple_cache
  2. ./build.sh
  3. ./build/simple-cache-example
  4. See error

Expected behavior
i want to run this example.

Screenshots
image

Desktop (please complete the following information):

  • Ubuntu 22.04.3 LTS
  • CacheLib tag: v20240312_RC
@therealgymmy
Copy link
Contributor

can you share more details regarding your linux setup? Which ubuntu version is this?

@guaguastandup
Copy link

same question, same cachelib tag, I am using ubuntu22.04

can you share more details regarding your linux setup? Which ubuntu version is this?

@YuqingXiong
Copy link
Author

same question, same cachelib tag, I am using ubuntu22.04

can you share more details regarding your linux setup? Which ubuntu version is this?

me too. I am using Ubuntu 22.04.3 LTS

@YuqingXiong
Copy link
Author

In fact, I have an inelegant solution.

I just commented the error output code, like this:

image

Then, return back Cachelib directory, and remove all build files:
rm -rf ./build-*

Finally, again to build, but not use git:
./contrib/build.sh -d -j -v -S

This error will not apper, but I think it might cause other bugs in the future.

@YuqingXiong
Copy link
Author

can you share more details regarding your linux setup? Which ubuntu version is this?

Of course, this is my system information. I use the Ubuntu 22.04.3 LTS and g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0

image

@MaoZiming
Copy link

Same problem

@KIDSSCC
Copy link

KIDSSCC commented Apr 1, 2025

I have frequently encountered issues with conflicts in the dynamically linked glog library. Based on my testing, a likely cause is that when building CacheLib, the -d option is used to compile third-party libraries in debug mode.

For example, in the case of glog, the CacheLib test programs attempt to link against the release version of glog during compilation. However, the CacheLib build list only includes the debug version. As a result, the compiler ultimately links against the system-wide release version of glog, while thriftcpp2 links against the debug version of glog. This mismatch leads to dependency conflicts.

I am unsure if this issue has been resolved in newer versions, but for v2023.04.24.00, it can be mitigated by running build.sh without the -d option.

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

5 participants