Page 1 of 1

Visual Studio 2015

Posted: Tue Apr 12, 2016 12:49 pm
by CalvinRi
Hi

I'm using RCF 1.3.1 for a while now in my app.

I'm having compiler problems while building in VS2015. I was building my app with all older Visual Studio versions (2008, 2010, 2012, 2013) without any problems, and now I cannot build it anymore, because of numerous compiler errors, without some clear point what is wrong.

Then I downloaded version RCF 2.1.0.0, combined with boost 1.55 or 1.59, I have only one error: Error C2039 'serialize': is not a member of boost::shared_ptr<Repository::CMyClass>'

Note that this error was never here in onlder VS versions, and everything was working well.

But, if I use latest boost (1.6), then I get this error: Error C2665 'SF::sfNewImpl': none of the 2 overloads could convert all the argument types RepositoryClientPlugin_RSNetwork xxxx\RCF-2\include\SF\SfNew.hpp

First error suggests that I do not have serialize implemented in my class, but I do not know what second error actually means.

Any hints?

Thank you

Re: Visual Studio 2015

Posted: Tue Apr 12, 2016 11:36 pm
by jarl
Hi,

We have a new RCF release which is just about ready to go out the door. It has been tested against both VS 2015 and Boost 1.60.0 , so most likely that will resolve your issues. It should be on the website within the next few days.

Re: Visual Studio 2015

Posted: Wed Apr 13, 2016 6:45 am
by CalvinRi
Thank you for your answer!

Re: Visual Studio 2015

Posted: Tue Apr 19, 2016 11:21 am
by CalvinRi
I tried to build with latest version, ending with the same result. RCF complained that there is no serialize function defined for my objects, but that was not true, at least for older compilers.

Code: Select all

void serialize(SF::Archive &ar, CRepositoryFile &file);
void serialize(SF::Archive &ar, CNetRepositoryItem &item);
void serialize(SF::Archive &ar, CNetCatalogueItem &item);
Then I went into the code, and realized that he is complaining because I actually use shared pointers from boost, so I wrote another 3 functions,just as wrappers for first 3:

Code: Select all

void serialize(SF::Archive &ar, boost::shared_ptr<CRepositoryFile> &file);
void serialize(SF::Archive &ar, boost::shared_ptr<CNetRepositoryItem> &item);
void serialize(SF::Archive &ar, boost::shared_ptr<CNetCatalogueItem> &item);
And it built without errors.

I understand the problem, but I do not know why it worked before.

Re: Visual Studio 2015

Posted: Tue Apr 19, 2016 11:40 am
by jarl
OK, I see. If you are serializing shared_ptr<> objects, all you need to do is put this:

Code: Select all

#include <SF/shared_ptr.hpp>
, at the top of your source code.