Closed biepenghaomie closed 10 months ago
Hi, I have the sale issue Is there a solution for ?
Hi, I have the sale issue Is there a solution for ?
Of cause. You can use other name to replace 'IStream' like 'iStream'. And recompile it. Luckly,jsoncpp use 'IStream' less. So you just pay a little time to change all 'IStream' in jsoncpp source code.
I find soltion to incldue afxole.h before include jsoncpp.h and it works thanks
What's the nature of the conflict? If it's macros, then I would recommend isolating the windows header inclusion into a wrapper .cpp file. Only include it off to the side, where it can do less damage to other headers like jsoncpp's headers.
What's the nature of the conflict? If it's macros, then I would recommend isolating the windows header inclusion into a wrapper .cpp file. Only include it off to the side, where it can do less damage to other headers like jsoncpp's headers.
Windows header CommCtrl.h has a struct declare which name is IStream in the header. So it make the conflict between windows header and jsoncpp.
But jsoncpp defines a Json::IStream
, so it's in the Json
namespace.
https://github.com/open-source-parsers/jsoncpp/blob/69098a18b9af0c47549d9a271c054d13ca92b006/include/json/config.h#L139
This sounds like the conflict is happening due to the user code breaking the separation between namespaces?
Perhaps the user code has using namespace Json;
directives or similar usage? If so, just don't do that.
I would like to see a repro and to see what the compiler's actual error message is.
But jsoncpp defines a
Json::IStream
, so it's in theJson
namespace.This sounds like the conflict is happening due to the user code breaking the separation between namespaces?
Perhaps the user code has
using namespace Json;
directives or similar usage? If so, just don't do that.I would like to see a repro and to see what the compiler's actual error message is.
You're right. Thanks for your reminder. I overlooked this issue at the time.
windowsSDK‘s include CommCtrl.h using a struct IStream.jsoncpp using IStream = std::istream; this make conflict.