QtXml/qdom.h proplems in a qt project - qt

I'm using CGAL , libQGLViewer libraries in a project on QT creator , Fedora 27
but it shows errors on the header file of the libraries
Compile output:
/usr/include/QtXml/qdom.h:99:20: error: variable ‘Q_XML_EXPORT QDomImplementation’ has initializer but incomplete type
class Q_XML_EXPORT QDomImplementation
^~~~~~~~~~~~~~~~~~
/usr/include/QtXml/qdom.h:101:1: error: expected primary-expression before ‘public’
public:
^~~~~~
/usr/include/QtXml/qdom.h:101:1: error: expected ‘}’ before ‘public’
/usr/include/QtXml/qdom.h:101:1: error: expected ‘,’ or ‘;’ before ‘public’
/usr/include/QtXml/qdom.h:103:30: error: ‘QDomImplementation’ does not name a type
QDomImplementation(const QDomImplementation&);
^~~~~~~~~~~~~~~~~~
/usr/include/QtXml/qdom.h:103:50: error: expected constructor, destructor, or type conversion before ‘;’ token
QDomImplementation(const QDomImplementation&);
^
/usr/include/QtXml/qdom.h:104:26: error: expected constructor, destructor, or type conversion before ‘;’ token
~QDomImplementation();
^
/usr/include/QtXml/qdom.h:105:5: error: ‘QDomImplementation’ does not name a type
QDomImplementation& operator= (const QDomImplementation&);
^~~~~~~~~~~~~~~~~~
/usr/include/QtXml/qdom.h:106:28: error: ‘QDomImplementation’ does not name a type
bool operator== (const QDomImplementation&) const;
^~~~~~~~~~~~~~~~~~
/usr/include/QtXml/qdom.h:106:49: error: non-member function ‘bool operator==(const int&)’ cannot have cv-qualifier
bool operator== (const QDomImplementation&) const;
^~~~~
/usr/include/QtXml/qdom.h:106:49: error: ‘bool operator==(const int&)’ must have an argument of class or enumerated type
/usr/include/QtXml/qdom.h:107:28: error: ‘QDomImplementation’ does not name a type
bool operator!= (const QDomImplementation&) const;
^~~~~~~~~~~~~~~~~~
/usr/include/QtXml/qdom.h:107:49: error: non-member function ‘bool operator!=(const int&)’ cannot have cv-qualifier
bool operator!= (const QDomImplementation&) const;
^~~~~
/usr/include/QtXml/qdom.h:107:49: error: ‘bool operator!=(const int&)’ must have an argument of class or enumerated type
/usr/include/QtXml/qdom.h:110:69: error: non-member function ‘bool hasFeature(const QString&, const QString&)’ cannot have cv-qualifier
bool hasFeature(const QString& feature, const QString& version) const;
^~~~~
/usr/include/QtXml/qdom.h:121:1: error: expected unqualified-id before ‘private’
private:
^~~~~~~
/usr/include/QtXml/qdom.h:123:51: error: expected constructor, destructor, or type conversion before ‘;’ token
QDomImplementation(QDomImplementationPrivate*);
^
/usr/include/QtXml/qdom.h:125:5: error: ‘friend’ used outside of class
friend class QDomDocument;
^~~~~~
/usr/include/QtXml/qdom.h:126:1: error: expected declaration before ‘}’ token
};
all errors appear in QtXml/qdom.h file , I have no idea how to solve them
I appreciate any help,
thanks

Related

Compiling fails, D programming (GDC)

So I have installed gdc trying to do a simple compile at command prompt. Not sure if my imports\includes actually work? What should I do? I am 100% sure the program compiles with Eclipse\dub\dtt\ldc...
*C:\Development\gdc\bin>x86_64-unknown-linux-gnu-gdc C:\Users\plann\Downloads\test\MessageApp\src\app.d --sysroot=C:\Development\gdc\sysroot -B "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\lib"
C:\Users\plann\Downloads\test\MessageApp\src\app.d:13:7: error: undefined identifier 'DWORD'
DWORD bakgrunfar = 0;
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:14:7: error: undefined identifier 'DWORD'
DWORD textfar = 0;
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:17:7: error: undefined identifier 'HFONT'
HFONT hFont, hOldFont;
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:17:14: error: undefined identifier 'HFONT'
HFONT hFont, hOldFont;
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:20:5: error: undefined identifier 'HWND'
int WindowProcedure (HWND, UINT, WPARAM, LPARAM );
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:20:5: error: undefined identifier 'UINT'
int WindowProcedure (HWND, UINT, WPARAM, LPARAM );
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:20:5: error: undefined identifier 'WPARAM'
int WindowProcedure (HWND, UINT, WPARAM, LPARAM );
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:20:5: error: undefined identifier 'LPARAM'
int WindowProcedure (HWND, UINT, WPARAM, LPARAM );
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:23:5: error: undefined identifier 'HINSTANCE'
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:23:5: error: undefined identifier 'HINSTANCE'
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:23:5: error: undefined identifier 'LPSTR'
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:44:5: error: undefined identifier 'HINSTANCE'
int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:44:5: error: undefined identifier 'HINSTANCE'
int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:44:5: error: undefined identifier 'LPSTR'
int myWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:99:5: error: undefined identifier 'HWND'
int WindowProcedure(HWND hwnd, UINT AEX, WPARAM wParam, LPARAM lParam) nothrow
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:99:5: error: undefined identifier 'UINT'
int WindowProcedure(HWND hwnd, UINT AEX, WPARAM wParam, LPARAM lParam) nothrow
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:99:5: error: undefined identifier 'WPARAM'
int WindowProcedure(HWND hwnd, UINT AEX, WPARAM wParam, LPARAM lParam) nothrow
^
C:\Users\plann\Downloads\test\MessageApp\src\app.d:99:5: error: undefined identifier 'LPARAM'
int WindowProcedure(HWND hwnd, UINT AEX, WPARAM wParam, LPARAM lParam) nothrow*
We cannot help without taking a look at the app.d. From the errors it seems that you did not import windows module that defines the various Windows-specific types.. Start with the following two typical imports:
import core.runtime;
import core.sys.windows.windows;
I strongly suggest you reading the following guide: https://wiki.dlang.org/D_for_Win32

php7.1RC5 enable dmalloc compiling error

I just wanted to build PHP7 with enable-dmalloc
enveronment:
the version of PHP is 7.1.0RC5
debian 8
gcc6.2
dmalloc 5.5.2
used this command:
./configure --prefix=/usr/local/php/70 --with-config-file-path=/usr/local/lib/php/70/etc --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-apxs2=/usr/local/httpd/2.4/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pgsql=/usr/local/PostgreSQL/9.5 --with-pdo-mysql=/usr/local/mysql --with-pdo-pgsql=/usr/local/PostgreSQL/ --enable-ftp --enable-zip --with-bz2 --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir -with-zlib --enable-bcmath --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --with-freetype-dir --enable-gd-native-ttf --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-exif --enable-debug --enable-phpdbg --enable-phpdbg-webhelper --enable-phpdbg-debug --enable-dtrace --enable-dmalloc --with-openssl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-pear --enable-maintainer-zts
make
but it failed with the the Error Message:
/usr/include/malloc.h:38:35: error: expected declaration specifiers or ‘...’ before string constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:35: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
In file included from /usr/local/src/php-7.1.0RC5/main/php.h:26:0,
from /usr/local/src/php-7.1.0RC5/ext/gd/libgd/gdhelpers.h:5,
from /usr/local/src/php-7.1.0RC5/ext/gd/libgd/gdft.c:13:
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before ‘(’ token extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:41:51: error: expected declaration specifiers or ‘...’ before string constant extern void *calloc (size_t __nmemb, size_t __size)
/usr/include/malloc.h:49:49: error: expected declaration specifiers or ‘...’ before string constant extern void *realloc (void *__ptr, size_t __size)
/usr/include/malloc.h:53:30: error: expected declaration specifiers or ‘...’ before string constant extern void free (void *__ptr) __THROW;
/usr/include/malloc.h:59:57: error: expected declaration specifiers or ‘...’ before string constant extern void *memalign (size_t __alignment, size_t __size)
/usr/include/malloc.h:63:35: error: expected declaration specifiers or ‘...’ before string constant extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
Makefile:1028: recipe for target 'ext/gd/libgd/gdft.lo' failed
make: *** [ext/gd/libgd/gdft.lo] Error 1
I see the source code in gdft.c, gdhelper.h and php.h, found this line:
#ifdef HAVE_DMALLOC
#include <dmalloc.h>
#endif
it maybe dmalloc caused this error, but I don't know why the error msg show malloc.h, I checked /usr/include, it has malloc.h and dmalloc.h two files
I install the package libdmalloc and libdmalloc-dev and I try to reinstall dmalloc with sourcecode but it's not helpful
What are the causes of these and how do I deal it ?

Qt not recognising declared class

I use Qt 4.6.3 to write application for FriendlyARM. I am trying to pass 2 pointers (pointing to classes axesParam1 and mainWin) to current class localTime but get these errors :
localtime.h:17: error: 'axesParam1' has not been declared
localtime.h:18: error: 'mainWin' has not been declared
localtime.h:26: error: ISO C++ forbids declaration of 'axesParam1' with no type
localtime.h:26: error: expected ';' before '*' token
localtime.h:27: error: ISO C++ forbids declaration of 'mainWin' with no type
localtime.h:27: error: expected ';' before '*' token
In file included from trackinputstatus.h:5,
from trackinput.h:5,
from mainwin.h:8,
from geoparam.h:5,
from axesparam3.h:5,
from axesparam2.h:5,
from axesparam1.h:5,
from main.cpp:14:
trackparamstatus.h:16: error: 'mainWin' has not been declared
trackparamstatus.h:24: error: ISO C++ forbids declaration of 'mainWin' with no type
trackparamstatus.h:24: error: expected ';' before '*' token
main.cpp: In function 'int main(int, char**)':
main.cpp:52: error: no matching function for call to 'localTime::setChildren(axesParam1*)'
localtime.h:17: note: candidates are: void localTime::setChildren(int*)
main.cpp:61: error: no matching function for call to 'localTime::setHome(mainWin*)'
localtime.h:18: note: candidates are: void localTime::setHome(int*)
main.cpp:62: error: no matching function for call to 'trackParamStatus::setHome(mainWin*)'
trackparamstatus.h:16: note: candidates are: void trackParamStatus::setHome(int*)
I did not declared setChildern to accept int* as an argument so why is it insisting on int*?
I have included the header file localtime.h
#ifndef LOCALTIME_H
#define LOCALTIME_H
#include &ltQWidget>
#include "axesparam1.h"
#include "mainwin.h"
namespace Ui {
class localTime;
}
class localTime : public QWidget {
Q_OBJECT
public:
localTime(QWidget *parent = 0);
~localTime();
void setChildren(axesParam1 *);
void setHome(mainWin *);
protected:
void changeEvent(QEvent *e);
private:
Ui::localTime *ui;
axesParam1 *P1;
mainWin *w;
};
#endif // LOCALTIME_H
You look too far down. Before you look at setChildern you should look into axesparam1 and/or mainwin.
localtime.h:17: error: 'axesParam1' has not been declared
localtime.h:18: error: 'mainWin' has not been declared
You have some syntex error earlier. setChildern is only some follow-up error.

Qt: Iterators and OBject: copy constructor error

In class called UserForms, I define a list (QList) or SqlQueryModel objects (subclass of QSqlQueryModel), as in this Qt tutorial.
In userforms.h:
QList<SqlQueryModel> userModels;
Then in my main code, I want to iterate over userModel, so I tried both of the following:
UserForm selectedUF = formSelectorDiag.getSelectedUF();
QList<SqlQueryModel>::iterator umIt;
for(umIt = selectedUF.userModels.begin(); umIt != selectedUF.userModels.end(); umIt++){
SqlQueryModel model = *umIt;
// Additional code removed since error happens on previous line.
}
And:
QListIterator<SqlQueryModel> umIt(selectedUF.userModels);
With both, I get a "copy constructor" error, although, I don't copy the constructor (or I don't think I do). Cf sqlquerymodel.h:
class SqlQueryModel : public QSqlQueryModel
{
Q_OBJECT
void generateRoleNames();
public:
explicit SqlQueryModel(QObject *parent = 0);
void setQuery(const QString &query, const QSqlDatabase &db = QSqlDatabase());
void setQuery(const QSqlQuery &query);
QVariant data(const QModelIndex &index, int role) const;
QHash<QString, QVariant> bindings; // Not used yet. Will be replaced by Binding class.
QString modelName;
QString query;
signals:
void bindedValueChanged();
public slots:
void search(QString);
void reset();
void updateBindings();
};
Here's the full exact error:
In file included from ..\..\..\..\Qt\4.8.4\include\QtSql/qsqlquerymodel.h:1:0,
from ..\..\..\..\Qt\4.8.4\include\QtSql/QSqlQueryModel:1,
from ..\SSL_Tool\/sqlquerymodel.h:4,
from ..\SSL_Tool\main.cpp:12:
..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/kernel/qabstractitemmodel.h: In copy constructor 'QSqlQueryModel::QSqlQueryModel(const QSqlQueryModel&)':
..\..\..\..\Qt\4.8.4\include\QtSql/../../src/sql/models/qsqlquerymodel.h:37:20: instantiated from 'void QList<T>::node_copy(QList<T>::Node*, QList<T>::Node*, QList<T>::Node*) [with T = SqlQueryModel]'
..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/tools/qlist.h:689:9: instantiated from 'void QList<T>::detach_helper(int) [with T = SqlQueryModel]'
..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/tools/qlist.h:703:5: instantiated from 'void QList<T>::detach_helper() [with T = SqlQueryModel]'
..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/tools/qlist.h:100:80: instantiated from 'QList<T>::QList(const QList<T>&) [with T = SqlQueryModel]'
..\SSL_Tool\/userform.h:17:7: instantiated from here
..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/kernel/qabstractitemmodel.h:338:5: error: 'QAbstractTableModel::QAbstractTableModel(const QAbstractTableModel&)' is private
..\..\..\..\Qt\4.8.4\include\QtSql/../../src/sql/models/qsqlquerymodel.h:37:20: error: within this context
In file included from ..\SSL_Tool\main.cpp:12:0:
..\SSL_Tool\/sqlquerymodel.h: In copy constructor 'SqlQueryModel::SqlQueryModel(const SqlQueryModel&)':
..\SSL_Tool\/sqlquerymodel.h:14:7: note: synthesized method 'QSqlQueryModel::QSqlQueryModel(const QSqlQueryModel&)' first required here
In file included from ..\..\..\..\Qt\4.8.4\include/QtCore/qlist.h:1:0,
from ..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/kernel/qobject.h:28,
from ..\..\..\..\Qt\4.8.4\include/QtCore/qobject.h:1,
from ..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/kernel/qcoreapplication.h:23,
from ..\..\..\..\Qt\4.8.4\include/QtCore/qcoreapplication.h:1,
from ..\..\..\..\Qt\4.8.4\include\QtGui/../../src/gui/kernel/qapplication.h:23,
from ..\..\..\..\Qt\4.8.4\include\QtGui/qapplication.h:1,
from ..\..\..\..\Qt\4.8.4\include\QtGui/QApplication:1,
from ..\SSL_Tool\main.cpp:1:
..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/tools/qlist.h: In member function 'void QList<T>::node_copy(QList<T>::Node*, QList<T>::Node*, QList<T>::Node*) [with T = SqlQueryModel]':
..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/tools/qlist.h:689:9: instantiated from 'void QList<T>::detach_helper(int) [with T = SqlQueryModel]'
..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/tools/qlist.h:703:5: instantiated from 'void QList<T>::detach_helper() [with T = SqlQueryModel]'
..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/tools/qlist.h:100:80: instantiated from 'QList<T>::QList(const QList<T>&) [with T = SqlQueryModel]'
..\SSL_Tool\/userform.h:17:7: instantiated from here
..\..\..\..\Qt\4.8.4\include/QtCore/../../src/corelib/tools/qlist.h:377:17: note: synthesized method 'SqlQueryModel::SqlQueryModel(const SqlQueryModel&)' first required here
mingw32-make[1]: Leaving directory `C:/Users/XXX/build-SSL_Tool-Desktop-Debug'
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make: *** [debug] Error 2
Any idea why?
QSqlQueryModel (and all other QObject-derived objects) can't be copied using copy constructor. QList requires its element type to have copy constructor. So, you need to use QList<SqlQueryModel*> instead of QList<SqlQueryModel>. You should create and delete your model objects manually using new and delete.

serializing union type via custom function: "static assertion failed:: typex::value"

I am serializing the cl_long2 type from OpenCL which is defined like this (simplified from /usr/include/CL/cl_platform.hpp):
typedef int64_t cl_long;
typedef union
{
cl_long __attribute__ ((aligned(16))) s[2];
struct{ cl_long x, y; };
struct{ cl_long s0, s1; };
struct{ cl_long lo, hi; };
} cl_long2;
I defined the following stand-alone serialization function:
namespace boost{ namespace serialization {
template<class Archive> void serialize(Archive &ar, cl_long2 &i, const unsigned version){
ar & make_nvp("x",i.x);
ar & make_nvp("y",i.y);
}
}};
When I compile my code, which invokes a serialization of cl_long2 from as a class member, I am getting the following error, which I cannot understand (the error is the same if it is not a std::vector<cl_long2>, just a stand-alone variable):
/usr/include/boost/archive/detail/check.hpp: In function ‘void boost::archive::detail::check_object_level() [with T = cl_long2]’:
/usr/include/boost/archive/detail/iserializer.hpp:438:9: instantiated from ‘static void boost::archive::detail::load_non_pointer_type<Archive>::invoke(Archive&, T&) [with T = cl_long2, Archive = boost::archive::xml_iarchive]’
/usr/include/boost/archive/detail/iserializer.hpp:592:5: instantiated from ‘void boost::archive::load(Archive&, T&) [with Archive = boost::archive::xml_iarchive, T = cl_long2]’
/usr/include/boost/archive/detail/common_iarchive.hpp:66:9: instantiated from ‘void boost::archive::detail::common_iarchive<Archive>::load_override(T&, int) [with T = cl_long2, Archive = boost::archive::xml_iarchive]’
/usr/include/boost/archive/basic_xml_iarchive.hpp:86:9: instantiated from ‘void boost::archive::basic_xml_iarchive<Archive>::load_override(const boost::serialization::nvp<T>&, int) [with T = cl_long2, Archive = boost::archive::xml_iarchive]’
/usr/include/boost/archive/xml_iarchive.hpp:93:9: instantiated from ‘void boost::archive::xml_iarchive_impl<Archive>::load_override(T&, int) [with T = const boost::serialization::nvp<cl_long2>, Archive = boost::archive::xml_iarchive]’
/usr/include/boost/archive/detail/interface_iarchive.hpp:60:9: [ skipping 5 instantiation contexts ]
/usr/include/boost/serialization/split_free.hpp:58:9: instantiated from ‘static void boost::serialization::free_loader<Archive, T>::invoke(Archive&, T&, unsigned int) [with Archive = boost::archive::xml_iarchive, T = std::vector<cl_long2>]’
/usr/include/boost/serialization/split_free.hpp:74:5: instantiated from ‘void boost::serialization::split_free(Archive&, T&, unsigned int) [with Archive = boost::archive::xml_iarchive, T = std::vector<cl_long2>]’
/usr/include/boost/serialization/vector.hpp:151:5: instantiated from ‘void boost::serialization::serialize(Archive&, std::vector<U, Allocator>&, unsigned int) [with Archive = boost::archive::xml_iarchive, U = cl_long2, Allocator = std::allocator<cl_long2>]’
/usr/include/boost/serialization/serialization.hpp:128:9: instantiated from ‘void boost::serialization::serialize_adl(Archive&, T&, unsigned int) [with Archive = boost::archive::xml_iarchive, T = std::vector<cl_long2>]’
/usr/include/boost/archive/detail/iserializer.hpp:188:5: instantiated from ‘void boost::archive::detail::iserializer<Archive, T>::load_object_data(boost::archive::detail::basic_iarchive&, void*, unsigned int) const [with Archive = boost::archive::xml_iarchive, T = std::vector<cl_long2>]’
myFile.cpp:368:2: instantiated from here
/usr/include/boost/archive/detail/check.hpp:60:5: error: static assertion failed: "typex::value"
The same error appears regardless of whether the archive type is xml or binary. I am using boost::serialization 1.46.
Any hints?
**EDIT: A smaller example including error is at http://ideone.com/4UgCn
If you look at the line where the assertion fails (detail/check.hpp:60), there is a comment right above it:
// trap attempts to serialize objects marked
// not_serializable
BOOST_STATIC_ASSERT(typex::value);
The documentation of this 'not_serializable' trait says that you have to enable this long2 type first. As you found out, this is done by:
BOOST_CLASS_IMPLEMENTATION(long2,boost::serialization::object_serializable)

Resources