Comments (6)
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.
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.
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:
- Remove/Delete the
qjsonserializer_helpertypes.h
header - 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.
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.
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.
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)
- QHash<int, QString> workaround HOT 2
- It can't convert QSharedPointer successfully.
- How to deserialize derived classes that use none-default constructors HOT 2
- Mac build "make" step giving .reggen errors. Any advice? HOT 2
- Add module fail HOT 1
- Using multiple instances in Qt subdir HOT 3
- Q_GADGET and QVariantList HOT 1
- Deserialization QPair within QVariant
- Cannot find missing dependency "qt.qt5.5130.android_arm64_v8a" ...
- Runtime exception occurred in sample.
- Sample: SerializationException (Unable to determine typeid of meta enum SampleObject::SuperFlags) HOT 1
- Converting QtJsonSerializer from QMake to CMake HOT 1
- Add entries in the repository for Qt 5.15.* and 6
- CopperSpice support HOT 2
- head of line cannot run sample application HOT 1
- Can not serialize enum properties HOT 3
- Poor performance for array of PODs with simple properties
- registerSetConverters results in build time error no matching function to call qHash(...
- Deserialize into existing object
- Create references to existing object , not duplicates HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qtjsonserializer.