Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/130.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ BOOST_类_导出语法错误_C++_Serialization_Boost - Fatal编程技术网

C++ BOOST_类_导出语法错误

C++ BOOST_类_导出语法错误,c++,serialization,boost,C++,Serialization,Boost,我在我的项目中使用VS12,我定义了一个非常简单的类,它序列化了它的属性。但是,当我放入BOOST\u CLASS\u导出时,我得到一个语法错误: syntax error : missing ';' before '<' 拿着书,读,读。微软是VisualStudio bug的守护者,你应该问他们这个问题。但是,如果您发布MCVE,我们可能会为您提供帮助。通过预处理器运行您的代码,您将看到为什么预处理器不希望出现 namespace a { namespace b { clas

我在我的项目中使用VS12,我定义了一个非常简单的类,它序列化了它的属性。但是,当我放入
BOOST\u CLASS\u导出时,我得到一个语法错误:

syntax error : missing ';' before '<'

拿着书,读,读。微软是VisualStudio bug的守护者,你应该问他们这个问题。但是,如果您发布MCVE,我们可能会为您提供帮助。通过预处理器运行您的代码,您将看到为什么预处理器不希望出现

namespace a { namespace b {
    class BaseSerialization {
        public:
            BaseSerialization(const std::string& functionName) : functionName(functionName) { }
            virtual void getFunctionName() const = 0;

        private:
            friend class ::boost::serialization::access;

            template <class Archive> void serialize(Archive &ar, unsigned int const file_version) {
                ar & BOOST_SERIALIZATION_NVP(functionName);
            }

        protected:
            std::string functionName;
        };

        class FOOZZ : BaseSerialization {
        public:
            FOOZZ(const std::string& functionName) : BaseSerialization("a"), functionName(functionName) { }
            virtual void getFunctionName() {
                int a;
            }

        private:
            friend class ::boost::serialization::access;

            template <class Archive> void serialize(Archive &ar, unsigned /*int const file_version*/) {
                ar & BOOST_SERIALIZATION_NVP(functionName);
            }

        protected:
            std::string functionName;
        };
        BOOST_CLASS_EXPORT_GUID(FOOZZ, "FOOZZ")
// namespace a, namespace b