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

Linker Error: Symbol(s) already defined in cpprest_2_10d.lib #1488

Open
brentarias opened this issue Aug 21, 2020 · 0 comments
Open

Linker Error: Symbol(s) already defined in cpprest_2_10d.lib #1488

brentarias opened this issue Aug 21, 2020 · 0 comments

Comments

@brentarias
Copy link

I'm working with a git repo having a Visual Studio 2017 solution which builds successfully for everyone on my team...except for me. From a couple of my own C++ projects, I have almost two dozen LNK2005 linker errors referencing cpprest_2_10.lib like this one:

Error:
LNK2005 "public: __thiscall web::json::value::value(class web::json::value const &)" (??0value@json@web@@QAE@ABV012@@z) already defined in cpprest_2_10d.lib(cpprest_2_10d.dll)
File:
C:\repos\spirion\SearchAgent2\SdmScanner\cpprestsdk140.lib(json.obj)

I am intentionally using CppRestSDK, and yet I have no idea why there is reference specifically to this cpprest_2_10d.lib. When I build CppRestSDK, no such library is created. Instead the CppRestSDK build gives me a library called cpprestsdk140.lib.

My best guess of why I'm having a problem...is that I might be the only engineer who installed vcpkg and obtained the CppRestSDK through vcpkg. But here is the thing...I used vcpkg in the context of a stand-alone C++ console app that has no relationship to the main repo/solution I'm working on with my team. I would expect that there is zero "bleed" between these visual studio solutions. The solution that has the linker errors has no relation to vcpkg; instead it simply has a full copy of the CppRestSDK source code and builds from scratch. It builds its copy of CppRestSDK without any issues.

Any idea of how or why this is happening?

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