Problem with cyrillic symbols

Forum for posting problems using QxOrm library

Re: Problem with cyrillic symbols

Postby nickla » Thu Oct 18, 2012 7:38 am

There is no such problem that we can not solve.

Here is my solution of this problem and it works without _WIDE_XML.

I modified QxSerialize_QString.cpp and it supports cyrilic QString now:
Code: Select all
/****************************************************************************
**
** http://www.qxorm.com/
** http://sourceforge.net/projects/qxorm/
** Original file by Lionel Marty
**
** This file is part of the QxOrm library
**
** This software is provided 'as-is', without any express or implied
** warranty. In no event will the authors be held liable for any
** damages arising from the use of this software.
**
** GNU Lesser General Public License Usage
** This file must be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file 'license.lgpl.txt' included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you have questions regarding the use of this file, please contact :
** contact@qxorm.com
**
****************************************************************************/

#include <QxPrecompiled.h>

#include <QxSerialize/Qt/QxSerialize_QString.h>

#include <QxTraits/archive_wide_traits.h>
#include <QxTraits/archive_printable.h>

#include <QxMemLeak.h>

#include <vector>
#include <QtCore/QString>
#include <QtCore/QVector>
#include <boost/serialization/nvp.hpp>
#include <boost/archive/xml_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>
#include <boost/serialization/vector.hpp>

namespace boost {
namespace serialization {

template <bool isPrintable = false>
struct qx_serialize_qstring
{

   template <class Archive>
   static inline void save(Archive & ar, const QString & t, const unsigned int /*file_version*/)
   {
        std::vector<uint> tmp = t.toUcs4().toStdVector();
        ar << boost::serialization::make_nvp("QString2Usc4", tmp);
   }

   template <class Archive>
   static inline void load(Archive & ar, QString & t, const unsigned int /*file_version*/)
   {
        std::vector<uint> tmp;
        ar >> boost::serialization::make_nvp("QString2Usc4", tmp);
        t = QString::fromUcs4(&tmp[0],tmp.size());
   }

};

template <>
struct qx_serialize_qstring<true>
{

   template <class Archive>
   static inline void save(Archive & ar, const QString & t, const unsigned int /*file_version*/)
   {
      std::vector<uint> tmp = t.toUcs4().toStdVector();
      ar << boost::serialization::make_nvp("QString2Usc4", tmp);
   }

   template <class Archive>
   static inline void load(Archive & ar, QString & t, const unsigned int /*file_version*/)
   {
      std::vector<uint> tmp;
      ar >> boost::serialization::make_nvp("QString2Usc4", tmp);
      t = QString::fromUcs4(&tmp[0],tmp.size());
   }

};

template <class Archive>
inline void qx_save(Archive & ar, const QString & t, const unsigned int file_version)
{
   qx_serialize_qstring<qx::trait::is_archive_printable<Archive>::value>::save(ar, t, file_version);
}

template <class Archive>
inline void qx_load(Archive & ar, QString & t, const unsigned int file_version)
{
   qx_serialize_qstring<qx::trait::is_archive_printable<Archive>::value>::load(ar, t, file_version);
}

} // namespace boost
} // namespace serialization

QX_SERIALIZE_FAST_COMPIL_SAVE_LOAD_CPP(QString)


I changed save and load methods. And it works perfect.
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia

Re: Problem with cyrillic symbols

Postby qxorm » Thu Oct 18, 2012 9:36 am

Here is my solution of this problem and it works without _WIDE_XML...
...I changed save and load methods. And it works perfect.

Good newz !
But I will not change the serialization code of QString for now.
So, for me, the right solution is : if you want working with cyrillic symbols, just enable WIDE_XML option in QxConfig.h file and change the serialization type to wide_xml.
Or use binary serialization if you send data in the same environment (only Windows, only Linux, only 32bits, etc...).
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Problem with cyrillic symbols

Postby nickla » Sat Oct 20, 2012 7:34 pm

But when i enable WIDE_XML i can not compile project. I get this:

Code: Select all
-lQxOrmd -lqxServiceServerd -lboost_serialization -lQtSql -lQtXml -lQtNetwork -lQtCore -lpthread
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_iarchive<boost::archive::xml_wiarchive>::load_override(boost::archive::object_id_type&, int)'
make[1]: Leaving directory `/home/kna/qxorm/qxTaxiServer'
make: Leaving directory `/home/kna/qxorm/qxTaxiServer'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::save_end(char const*)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::end_preamble()'
../debug/libQxOrmd.so: undefined reference to `boost::archive::xml_wiarchive_impl<boost::archive::xml_wiarchive>::~xml_wiarchive_impl()'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_text_oprimitive<std::basic_ostream<wchar_t, std::char_traits<wchar_t> > >::~basic_text_oprimitive()'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::save_override(boost::archive::class_id_optional_type const&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::save_override(boost::archive::object_reference_type const&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_iarchive<boost::archive::xml_wiarchive>::load_start(char const*)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::detail::archive_serializer_map<boost::archive::xml_wiarchive>::insert(boost::archive::detail::basic_serializer const*)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::xml_wiarchive_impl<boost::archive::xml_wiarchive>::xml_wiarchive_impl(std::basic_istream<wchar_t, std::char_traits<wchar_t> >&, unsigned int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::save_override(boost::archive::tracking_type const&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::save_override(boost::archive::object_id_type const&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::detail::archive_serializer_map<boost::archive::xml_woarchive>::find(boost::serialization::extended_type_info const&)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_iarchive<boost::archive::xml_wiarchive>::load_override(boost::archive::class_id_type&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::xml_wiarchive_impl<boost::archive::xml_wiarchive>::load(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >&)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::xml_woarchive_impl<boost::archive::xml_woarchive>::save(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::detail::archive_serializer_map<boost::archive::xml_woarchive>::insert(boost::archive::detail::basic_serializer const*)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::save_override(boost::archive::version_type const&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_iarchive<boost::archive::xml_wiarchive>::load_end(char const*)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::~basic_xml_oarchive()'
../debug/libQxOrmd.so: undefined reference to `boost::archive::xml_woarchive_impl<boost::archive::xml_woarchive>::save(std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > const&)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_iarchive<boost::archive::xml_wiarchive>::load_override(boost::archive::tracking_type&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::detail::archive_serializer_map<boost::archive::xml_wiarchive>::erase(boost::archive::detail::basic_serializer const*)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::detail::archive_serializer_map<boost::archive::xml_woarchive>::erase(boost::archive::detail::basic_serializer const*)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::save_override(boost::archive::class_id_type const&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::detail::archive_serializer_map<boost::archive::xml_wiarchive>::find(boost::serialization::extended_type_info const&)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::xml_woarchive_impl<boost::archive::xml_woarchive>::xml_woarchive_impl(std::basic_ostream<wchar_t, std::char_traits<wchar_t> >&, unsigned int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::save_start(char const*)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::xml_wiarchive_impl<boost::archive::xml_wiarchive>::load_override(boost::archive::class_name_type&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::save_override(boost::archive::class_name_type const&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_oarchive<boost::archive::xml_woarchive>::save_override(boost::archive::class_id_reference_type const&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::basic_xml_iarchive<boost::archive::xml_wiarchive>::load_override(boost::archive::version_type&, int)'
../debug/libQxOrmd.so: undefined reference to `boost::archive::xml_wiarchive_impl<boost::archive::xml_wiarchive>::load(std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
collect2: ld returned 1 exit status
make[1]: *** [../debug/qxTaxiServerd] Error 1
make: *** [debug] Error 2


I dont know how to fix it. Google doesnt know how to fix too. If you know how to fix it, please, write the solution here.

My method does not work in Windows. Server crashes on first event. I am trying to find out how to fix it.
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia

Re: Problem with cyrillic symbols

Postby nickla » Sun Oct 21, 2012 5:25 am

I fixed my solution. If somebody will use it here is last version:

Code: Select all
/****************************************************************************
**
** http://www.qxorm.com/
** http://sourceforge.net/projects/qxorm/
** Original file by Lionel Marty
**
** This file is part of the QxOrm library
**
** This software is provided 'as-is', without any express or implied
** warranty. In no event will the authors be held liable for any
** damages arising from the use of this software.
**
** GNU Lesser General Public License Usage
** This file must be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file 'license.lgpl.txt' included in the
** packaging of this file.  Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** If you have questions regarding the use of this file, please contact :
** contact@qxorm.com
**
****************************************************************************/

#include <QxPrecompiled.h>

#include <QxSerialize/Qt/QxSerialize_QString.h>

#include <QxTraits/archive_wide_traits.h>
#include <QxTraits/archive_printable.h>

#include <QxMemLeak.h>

#include <vector>
#include <QtCore/QString>
#include <QtCore/QVector>
#include <boost/serialization/nvp.hpp>
#include <boost/archive/xml_iarchive.hpp>
#include <boost/archive/xml_oarchive.hpp>
#include <boost/serialization/vector.hpp>

namespace boost {
namespace serialization {

template <bool isPrintable = false>
struct qx_serialize_qstring
{

   template <class Archive>
   static inline void save(Archive & ar, const QString & t, const unsigned int /*file_version*/)
   {
        std::vector<uint> tmp = t.toUcs4().toStdVector();
        ar << boost::serialization::make_nvp("QString2Usc4", tmp);
   }

   template <class Archive>
   static inline void load(Archive & ar, QString & t, const unsigned int /*file_version*/)
   {
        std::vector<uint> tmp;
        ar >> boost::serialization::make_nvp("QString2Usc4", tmp);
        t = QString::fromUcs4(&tmp[0],tmp.size());
   }

};

template <>
struct qx_serialize_qstring<true>
{

   template <class Archive>
   static inline void save(Archive & ar, const QString & t, const unsigned int /*file_version*/)
   {
      std::vector<uint> tmp = t.toUcs4().toStdVector();
      ar << boost::serialization::make_nvp("QString2Usc4", tmp);
   }

   template <class Archive>
   static inline void load(Archive & ar, QString & t, const unsigned int /*file_version*/)
   {
      std::vector<uint> tmp;
      ar >> boost::serialization::make_nvp("QString2Usc4", tmp);
      if (tmp.size() > 0) {
        t = QString::fromUcs4(&tmp[0],tmp.size());
      }
   }

};

template <class Archive>
inline void qx_save(Archive & ar, const QString & t, const unsigned int file_version)
{
   qx_serialize_qstring<qx::trait::is_archive_printable<Archive>::value>::save(ar, t, file_version);
}

template <class Archive>
inline void qx_load(Archive & ar, QString & t, const unsigned int file_version)
{
   qx_serialize_qstring<qx::trait::is_archive_printable<Archive>::value>::load(ar, t, file_version);
}

} // namespace boost
} // namespace serialization

QX_SERIALIZE_FAST_COMPIL_SAVE_LOAD_CPP(QString)




We need to check std::vector range.
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia

Re: Problem with cyrillic symbols

Postby qxorm » Mon Oct 22, 2012 8:39 am

But when i enable WIDE_XML i can not compile project.
... I dont know how to fix it.

boost serialization provides 2 differents libraries for serialization engine : one for wide serialization, and one for normal serialization.
So I think you are not linking to the right library !

For example, under Windows, I have those DLL :
* boost_serialization-vc100-mt-gd-1_49 for normal serialization process ;
* boost_wserialization-vc100-mt-gd-1_49 for wide serialization process (note the w in the name of the library) ;
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Problem with cyrillic symbols

Postby nickla » Thu Oct 25, 2012 4:37 am

I think that it is better to set _QX_SERIALIZE_WIDE_XML in*.pro file b\c we can choose what lib to link there.

There will be somebody who will ask such question again.

Problem is not solved. I added boost_wserialization-vc100-mt to link but receive this:

Code: Select all
C:\QtSDK\QtCreator\bin\jom.exe -nologo -j 4 -f Makefile.Debug
   link /LIBPATH:"c:\Qt\4.8.2\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /DLL /MANIFEST /MANIFESTFILE:"../debug/QxOrm\QxOrmd.intermediate.manifest" /OUT:..\debug\QxOrmd.dll @C:\Users\0E03~1\AppData\Local\Temp\QxOrmd.dll.5636.219.jom
   Creating library ..\debug\QxOrmd.lib and object ..\debug\QxOrmd.exp
QxSerialize_QString.obj : error LNK2019: unresolved external symbol "protected: void __thiscall boost::archive::xml_woarchive_impl<class boost::archive::xml_woarchive>::save(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)" (?save@?$xml_woarchive_impl@Vxml_woarchive@archive@boost@@@archive@boost@@IAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z) referenced in function "public: static void __cdecl boost::archive::save_access::save_primitive<class boost::archive::xml_woarchive,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > >(class boost::archive::xml_woarchive &,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > const &)" (??$save_primitive@Vxml_woarchive@archive@boost@@V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@save_access@archive@boost@@SAXAAVxml_woarchive@12@ABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z)
QxSerialize_QString.obj : error LNK2019: unresolved external symbol "protected: void __thiscall boost::archive::xml_wiarchive_impl<class boost::archive::xml_wiarchive>::load(class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > &)" (?load@?$xml_wiarchive_impl@Vxml_wiarchive@archive@boost@@@archive@boost@@IAEXAAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z) referenced in function "public: static void __cdecl boost::archive::load_access::load_primitive<class boost::archive::xml_wiarchive,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > >(class boost::archive::xml_wiarchive &,class std::basic_string<unsigned short,struct std::char_traits<unsigned short>,class std::allocator<unsigned short> > &)" (??$load_primitive@Vxml_wiarchive@archive@boost@@V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@load_access@archive@boost@@SAXAAVxml_wiarchive@12@AAV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z)
QxTools.obj : error LNK2019: unresolved external symbol "protected: __thiscall boost::archive::xml_woarchive_impl<class boost::archive::xml_woarchive>::xml_woarchive_impl<class boost::archive::xml_woarchive>(class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > &,unsigned int)" (??0?$xml_woarchive_impl@Vxml_woarchive@archive@boost@@@archive@boost@@IAE@AAV?$basic_ostream@GU?$char_traits@G@std@@@std@@I@Z) referenced in function "public: __thiscall boost::archive::xml_woarchive::xml_woarchive(class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > &,unsigned int)" (??0xml_woarchive@archive@boost@@QAE@AAV?$basic_ostream@GU?$char_traits@G@std@@@std@@I@Z)
QxTools.obj : error LNK2019: unresolved external symbol "protected: __thiscall boost::archive::basic_text_oprimitive<class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > >::~basic_text_oprimitive<class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > >(void)" (??1?$basic_text_oprimitive@V?$basic_ostream@GU?$char_traits@G@std@@@std@@@archive@boost@@IAE@XZ) referenced in function "protected: __thiscall boost::archive::xml_woarchive_impl<class boost::archive::xml_woarchive>::~xml_woarchive_impl<class boost::archive::xml_woarchive>(void)" (??1?$xml_woarchive_impl@Vxml_woarchive@archive@boost@@@archive@boost@@IAE@XZ)
QxTools.obj : error LNK2019: unresolved external symbol "protected: __thiscall boost::archive::xml_wiarchive_impl<class boost::archive::xml_wiarchive>::xml_wiarchive_impl<class boost::archive::xml_wiarchive>(class std::basic_istream<unsigned short,struct std::char_traits<unsigned short> > &,unsigned int)" (??0?$xml_wiarchive_impl@Vxml_wiarchive@archive@boost@@@archive@boost@@IAE@AAV?$basic_istream@GU?$char_traits@G@std@@@std@@I@Z) referenced in function "public: __thiscall boost::archive::xml_wiarchive::xml_wiarchive(class std::basic_istream<unsigned short,struct std::char_traits<unsigned short> > &,unsigned int)" (??0xml_wiarchive@archive@boost@@QAE@AAV?$basic_istream@GU?$char_traits@G@std@@@std@@I@Z)
..\debug\QxOrmd.dll : fatal error LNK1120: 5 unresolved externals
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia

Re: Problem with cyrillic symbols

Postby qxorm » Fri Oct 26, 2012 8:06 am

You are right, I have same errors on Windows with MSVC2008.

In QxConfig.h file, I wrote a comment :
/* -- Link error with VC++ 9.0 => Qt uses "-Zc:wchar_t-" option to compile and boost serialization library is compiled without this option -- */

If I remember well, this is the reason why it doesn't work.

But it should work on Linux (???).
Sorry, but I have no time to fix it for now !

Have you tried to enable the _QX_SERIALIZE_PORTABLE_BINARY option ?
It should be portable and maybe it will work with cyrillic symbols...
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Problem with cyrillic symbols

Postby nickla » Mon Oct 29, 2012 7:16 pm

I tried to compile with such options

Code: Select all
D:\projects\qtaxi_trunk\QxOrm\include\QxSerialize/boost/portable_binary/portable_iarchive.hpp(88) : fatal error C1083: Cannot open include file: 'boost/spirit/home/support/detail/integer/endian.hpp': No such file or directory


There is no such file in boost 1.50
nickla
 
Posts: 52
Joined: Wed Jul 11, 2012 4:19 pm
Location: Russia

Re: Problem with cyrillic symbols

Postby qxorm » Tue Oct 30, 2012 8:26 pm

Ok, so the boost spirit module has been changed since I developped the portable binary serialization (at least the include part).
So, I think the only way is to take into account my comment :
/* -- Link error with VC++ 9.0 => Qt uses "-Zc:wchar_t-" option to compile and boost serialization library is compiled without this option -- */

You could try to build your boost serialization wide library using -Zc:wchar_t compiler option : I don't know the command line to do it (using bjam for example), but I think it's possible (maybe reading the boost serialization documentation).
It should work and resolve your linker errors (but not tested yet !).

EDIT : here is a link talking about exactly the same issue ==> I will try to generate a boost package using the right compiler option to build boost serialization wide binaries :
http://stackoverflow.com/questions/4521 ... -the-world
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Problem with cyrillic symbols

Postby qxorm » Mon Nov 05, 2012 10:07 am

Here is my new boost package (based on boost 1.51) : http://www.qxorm.com/lib/boost_1_51.zip
You can download it, it works perfectly with boost wide serialization library and MSVC++ (no linker error due to wchar_t).

I added a note to the file 'version_1_51.txt' to explain what is the best way to build boost serialization :
-----------------
Note for MSVC++ :
-----------------
By default, Qt is built using "/Zc:wchar_t-" compiler option.
So we add cxxflags="/Zc:wchar_t- " parameter to bjam to build boost libraries in the same way.
But, to remove the following warning : "Command line warning D9025 : overriding '/Zc:wchar_t' with '/Zc:wchar_t-'".
We have to modify './tools/build/v2/tools/msvc.jam' file and remove '/Zc:wchar_t' in compiler options.
For QxOrm library, it's used only if you are working with boost wide serialization library.
-----------------

-----------------------------------------
COMMAND LINE TO BUILD USING MSVC++ 2008 :
-----------------------------------------
bjam.exe -d2 --build-dir=build --toolset=msvc-9.0 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared cxxflags="/Zc:wchar_t- " stage
bjam.exe -d2 --build-dir=build --toolset=msvc-9.0 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared cxxflags="/Zc:wchar_t- " install

-----------------------------------------
COMMAND LINE TO BUILD USING MSVC++ 2010 :
-----------------------------------------
bjam.exe -d2 --build-dir=build --toolset=msvc-10.0 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared cxxflags="/Zc:wchar_t- " stage
bjam.exe -d2 --build-dir=build --toolset=msvc-10.0 --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared cxxflags="/Zc:wchar_t- " install

---------------------------------------------
COMMAND LINE TO BUILD USING MINGW GCC 4.5.1 :
---------------------------------------------
bjam.exe --build-dir=build --toolset=gcc --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared stage
bjam.exe --build-dir=build --toolset=gcc --with-serialization variant=debug,release link=shared threading=multi runtime-link=shared install


Then, to test it, I just modified 2 files :

1- ./include/QxCommon/QxConfig.h file to enable _QX_SERIALIZE_WIDE_XML setting, like this :
Code: Select all
#define _QX_SERIALIZE_POLYMORPHIC            0

#define _QX_SERIALIZE_BINARY                 (! _QX_SERIALIZE_POLYMORPHIC && 1)
#define _QX_SERIALIZE_TEXT                   (! _QX_SERIALIZE_POLYMORPHIC && 0)
#define _QX_SERIALIZE_XML                    (! _QX_SERIALIZE_POLYMORPHIC && 1)
#define _QX_SERIALIZE_PORTABLE_BINARY        (! _QX_SERIALIZE_POLYMORPHIC && 0)

/* -- Link error with VC++ 9.0 => Qt uses "-Zc:wchar_t-" option to compile and boost serialization library is compiled without this option -- */
#define _QX_SERIALIZE_WIDE_BINARY            (! _QX_SERIALIZE_POLYMORPHIC && 0)
#define _QX_SERIALIZE_WIDE_TEXT              (! _QX_SERIALIZE_POLYMORPHIC && 0)
#define _QX_SERIALIZE_WIDE_XML               (! _QX_SERIALIZE_POLYMORPHIC && 1)


2- QxOrm.pri file to change boost settings to version 1.51 and to add a reference to the wide serialization library :
Code: Select all
...
QX_BOOST_INCLUDE_PATH = $$quote(D:/Dvlp/_Libs/Boost/1_51/include)
QX_BOOST_LIB_PATH = $$quote(D:/Dvlp/_Libs/Boost/1_51/lib_shared)
QX_BOOST_LIB_SERIALIZATION_DEBUG = "boost_serialization-vc90-mt-gd-1_51"
QX_BOOST_LIB_SERIALIZATION_RELEASE = "boost_serialization-vc90-mt-1_51"
...
CONFIG(debug, debug|release) {
LIBS += -l$${QX_BOOST_LIB_SERIALIZATION_DEBUG}
LIBS += -lboost_wserialization-vc90-mt-gd-1_51
} else {
LIBS += -l$${QX_BOOST_LIB_SERIALIZATION_RELEASE}
LIBS += -lboost_wserialization-vc90-mt-1_51
} # CONFIG(debug, debug|release)
...


Now, you are able to test cyrillic symbols using wide xml serialization engine...
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

PreviousNext

Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 11 guests

cron