Boost logo

Boost Users :

From: Yan Zhang (Yan.Zhang_at_[hidden])
Date: 2005-06-01 15:16:55

Hi Robert,


You are right, my MFC project RTTI is not enabled by default. Enable
RTTI, the example executes successfully. Thank you very much.





From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Robert Ramey
Sent: Wednesday, June 01, 2005 12:25 PM
To: boost-users_at_[hidden]
Subject: [Boost-users] Re: Re: boost.serialization 1.32
exampleexecutionfailsinMFC project (Visual Studio .NET 2003)


is rtti enabled? VC++ IDE doesn't enable it by default.


Robert Ramey

        "Yan Zhang" <Yan.Zhang_at_[hidden]> wrote in message

        Hi Jeff,


        I installed Boost 1.32 on my computer (Windows Server 2003 and
Visual Studio .NET 2003). A directory: \boost_1_32_0 was created. In
\boost_1_32_0\libs\serialization\vc7ide, I found the projects for
building serialization library and test examples. I can build the
library (libboost_serialization.lib) and examples, and they run well.
All examples are Windows console applications.


        Then I created an MFC application, linked it with the library.
In Document class, I did a test similar to the one presented in
demo_xml.cpp and demo_xml.hpp:




        #include "stdafx.h"

        #include "MFCTests.h"

        #include "MFCTestsDoc.h"

        #include <iostream>

        #include <sstream>

        #include <string>

        #include <boost/archive/tmpdir.hpp>

        #include <boost/archive/xml_oarchive.hpp>


        #include "demo_xml.hpp"




        void CMFCTestsDoc::OnTestSerialize()


            bus_stop *bs0 = new bus_stop_corner(

                gps_position(34, 135, 52.560f),

                gps_position(134, 22, 78.30f),

                "24th Street", "10th Avenue"



            std::string filename(boost::archive::tmpdir());

            filename += "/demo.xml";


            std::ofstream ofs(filename.c_str());


            boost::archive::xml_oarchive oa(ofs);

            oa << BOOST_SERIALIZATION_NVP(*bs0);





        Execution fails in last statement with message:


        Unhandled exception at 0x77e55dea in MFCTests.exe: Microsoft C++
exception: __non_rtti_object @ 0x0012e800.


        The build was debug build, application and library were build
with runtime library option "Multi-threaded Debug (/MTd)". I tried to
use different options such as "Multi-threaded Debug DLL (/MDd)", it
failed the same way.


        In MSDN
echart/html/boostvc.asp), it discussed Boost for Visual Studio C++. It
stated that Boost works well with VC++ 7.1. Of course we know it doesn't
work well with previous VC++ such as VC++ 6.0 which I tried and failed







        From: boost-users-bounces_at_[hidden]
[mailto:boost-users-bounces_at_[hidden]] On Behalf Of Jeff Flinn
        Sent: Wednesday, June 01, 2005 9:00 AM
        To: boost-users_at_[hidden]
        Subject: [Boost-users] Re: boost.serialization 1.32 example
execution failsinMFC project (Visual Studio .NET 2003)




        I extensively use boost 1.32 serialization in MFC projects with
no problems. You'll need to provide more info on your problem: some
code, exact error messages, etc.


        So is Boost really mentioned in MSDN?


        Jeff Flinn


        PS. Please restrict your postings to plain text. Other wise it's
difficult to avoid top posting.

                "Yan Zhang" <Yan.Zhang_at_[hidden]> wrote in message

                I installed Boost 1.32 in Windows with Visual Studio
.NET 2003. I tested serialization provided in "vc7ide" project, it runs
successfully. Of course, all test projects are "Console", no MFC library
involved. Then I used the same library in MFC project, the execution
failed in function:




                From MSDN, it was said that Boost is supported in Visual
Studio .NET 2003. I labored a week to upgrade our MFC project to Visual
Studio .NET 2003 and it still has problem. Any idea? Thanks in advance.





                Boost-users mailing list


        Boost-users mailing list

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at