Link Error when new SFSObject

Post here your questions about the C++ API for SFS2X

Moderators: Lapo, Bax, MBagnati

ganquan
Posts: 38
Joined: 17 Apr 2013, 01:42

Link Error when new SFSObject

Postby ganquan » 17 Apr 2013, 08:34

I try to new a SFSObject:

Code: Select all

void ConnectionTest::getCharactorList( )
{
   std::string* stdRequest = new string("getCharactorList");

   ISFSObject * param = new SFSObject;
   
   mSmartFox->Send( new ExtensionRequest(stdRequest, NULL) );
}


And i got a link error:
error LNK2019: "public: __thiscall Sfs2X::Entities::Data::SFSObject::SFSObject(void)" (??0SFSObject@Data@Entities@Sfs2X@@QAE@XZ)

But the other function, like new LogoutRequest work fine.

By the way, it VS2010 and C++ API 0.9.3.
ganquan
Posts: 38
Joined: 17 Apr 2013, 01:42

Re: Link Error when new SFSObject

Postby ganquan » 17 Apr 2013, 10:00

solven by add DLLImportExport to SFSObject.h file

Code: Select all

#ifndef __SFSObject__
#define __SFSObject__

#include "../../Util/Common.h"
.....
class DLLImportExport SFSObject : public ISFSObject
{
......
MBagnati
Posts: 126
Joined: 12 Feb 2013, 10:57

Re: Link Error when new SFSObject

Postby MBagnati » 17 Apr 2013, 21:53

Currently there are some objects (like SFSObject, RoomProperties, UserProperties, ...) that API does not export to client application.
The declaration of these objects is missing of the DLLImportExport attribute.
All objects will be available with rel. 0.9.4
User avatar
Bax
Site Admin
Posts: 4612
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: Link Error when new SFSObject

Postby Bax » 22 Apr 2013, 08:20

This was fixed in API v0.9.4 we just published: viewtopic.php?f=34&t=15963
Thank you for reporting.
Paolo Bax
The SmartFoxServer Team

Return to “SFS2X C++ API”

Who is online

Users browsing this forum: No registered users and 49 guests