-
Notifications
You must be signed in to change notification settings - Fork 84
cannot include json.hpp from more than one cpp file due to multiply defined symbols #4
Comments
i have the same problem. tried everything. it wont go away |
fixed the issue: although i created a cpp file, and i do not know how to developer wanted the lib to be(i think it meant to be only hpp file) so i will not commit. all you have to do it to take JSON::load implementation and put it in a cpp file. and add template <typename... T> above the functions: |
Not gonna lie, I totally forgot this issue was here. I have to rewrite the parser because of #8 so I'll likely fix this at the same time. Things need to be restructured anyways. Unfortunately it might be a little while until I can fix it, I'm in the middle of changing jobs and moving so I'm kinda swamped. |
@eduard739 thank you! totally solved my problem |
As issue nbsdx#4 points out, json.hpp can not be included from multiple files. Adding `inline` in front of non-template functions fix this issue without having to introduce a separate .cpp file.
Just a reminder.. I started using this lib and now I am encountering the same problem! |
including
json.hpp
in multiple cpp files leads to linker errors:Compiler is gcc 5.1.1 building on Fedora 22
The text was updated successfully, but these errors were encountered: