Git Product home page Git Product logo

Comments (6)

Skycoder42 avatar Skycoder42 commented on July 20, 2024

I have no machine available with VS2013. You can create a PR for this if you want. I wasn't expecting any compiler to not support that, as it is C++11 (which is required by latest Qt).

There is a Qt macro for that, Q_DECL_NOTHROW. This way you can make shure the fix actually works. Simply replace it, e.g.: void myFunc() noexcept -> void myFunc() Q_DECL_NOTHROW. If you encounter other keywords vs2013 does not support, you can do the same for those with the other Qt macros

from qtjsonserializer.

arietto avatar arietto commented on July 20, 2024

Thanks for your quick answer. I have other template-related errors:
d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(53) : error C2144: syntax error : 'bool' should be preceded by ';' (.\qjsonserializer.cpp) d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(58) : see reference to class template instantiation '_qjsonserializer_helpertypes::gadget_helper<T,Enable>' being compiled d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(53) : error C2144: syntax error : 'bool' should be preceded by ';' (.\qtjsonserializer_global.cpp) d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(58) : see reference to class template instantiation '_qjsonserializer_helpertypes::gadget_helper<T,Enable>' being compiled d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(53) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (.\qjsonserializer.cpp) d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(53) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (.\qtjsonserializer_global.cpp) d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(65) : error C2144: syntax error : 'bool' should be preceded by ';' (.\qjsonserializer.cpp) d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(70) : see reference to class template instantiation '_qjsonserializer_helpertypes::gadget_helper<T,T::QtGadgetHelper>' being compiled d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(65) : error C2144: syntax error : 'bool' should be preceded by ';' (.\qtjsonserializer_global.cpp) d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(70) : see reference to class template instantiation '_qjsonserializer_helpertypes::gadget_helper<T,T::QtGadgetHelper>' being compiled d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(65) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (.\qjsonserializer.cpp) d:\projects\qtjsonserializer\include\qtjsonserializer\../../src/jsonserializer/qjsonserializer_helpertypes.h(65) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int (.\qtjsonserializer_global.cpp) NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'

from qtjsonserializer.

Skycoder42 avatar Skycoder42 commented on July 20, 2024

Okay, that looks bad. These errors seem to indicate that one ore more of the type_traits classes are missing. However, the template parts rely on those, so 2013 is just to old.

However, you might be able still get it to work by removing the template functions:

  1. Remove/Delete the qjsonserializer_helpertypes.h header
  2. In qjsonserializer.h, remove all template methods that make use of the helpertypes. (that should be various overloads of serialize, deserialize, serializeTo and deserializeFrom).

By doing so, you might be able to compile, but loose the ability to use the templates. This means you have to now work with QVariant and QJsonValue only.

For example, this:

MyClass* data = ...;
QJsonObject o = serializer->serialize(data);

now becomes this:

MyClass* data = ...;
QJsonObject o = serializer->serialize(QVariant::fromValue<MyClass*>(data)).toObject();

from qtjsonserializer.

arietto avatar arietto commented on July 20, 2024

Ok, I' ll try it, thanks. I suppose that it is better to use lite (cut for VS 2013) 3.1.0 version of your library, than 2.2.2 version (which is VS2013 friendly out-of-the-box) .

from qtjsonserializer.

Skycoder42 avatar Skycoder42 commented on July 20, 2024

I would recommend that, yes. The reason I had to use the new c++11 template stuff in the beginning is because in 2.* it did not work for all cases. Also I made some breaking changes internally. So with "3.1.0 lite" you are better of. It makes migration easier too, if you ever plan to update your compiler ;)

from qtjsonserializer.

Skycoder42 avatar Skycoder42 commented on July 20, 2024

If you manage to get it run, feel free to publish the lite version as an PR. I won't merge it, but reference it in the README, so others that use VS2013 can use that one as well.

from qtjsonserializer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.