-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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 LNK2005 when compiling (x64) json-3.10.0.zip with Visual Studio 2019 16.11.1 #2941
Comments
Alright, I can reproduce what you're doing. You're building the binary
which still works. I'll check if it makes sense to fix the target |
I am building in the x64 Developer Command Prompt of Visual Studio 2019 16.11.1 with cmake 3.20.21032501-MSVC_2 (Visual Studio) and msbuild 16.11.0.36601 with a lot of parameters passed to cmake, but you can reproduce it very easily with this command:
I use normally these flags for cmake from json: |
But what do you build then? |
(The binary |
What is the issue you have?
Linker error LNK2005:
Can you provide a small but working solution / fix?
Add a namespace in both files
json\test\src\unit-disabled_exceptions.cpp
andjson\test\src\unit-regression2.cpp
:What is the expected behavior?
No link error
And what is the actual behavior instead?
LNK2005 error
Which compiler and operating system are you using?
Which version of the library did you use?
develop
branchIf you experience a compilation error: can you compile and run the unit tests?
The text was updated successfully, but these errors were encountered: