Trunk discussion / complains

So i’m really sorry, but I somehow manager to fuck up with serialization. I tested everything in my branches or at least I was sure that I’d tested everything and backward compatibility is okay. Unfortunately problem has come from the side I would never expect…

For some reason saves created with current develop code fail to load, trying to find out why… :frowning:

Most likely issue caused by that branch:
github.com/vcmi/vcmi/pull/144/files
Sadly I’m not 100% sure. :neutral_face:

So it’s end up problem is related to “destinationTeleportPos” serialization.
For some reason int3 don’t serialize / unserialize properly within VCAI and I don’t know why.

Fortunately this isn’t critical at all and won’t cause any issues because destinationTeleportPos can only be set when destinationTeleport (ObjectInstanceID) is set. It’s unlikely that anyone save game during AI turn and even in that case only problem is uninitialized value.

Now all save/loading should be okay.

I tried to compile VCMI after longer break and there are some significant issues with CTypeList:

Error	2	error C2440: 'return' : cannot convert from 'CGTownInstance *' to 'CGObjectInstance *'	d:\vcmi\vcmi\lib\mapobjects\CommonConstructors.h	44
Error	20	error LNK1120: 6 unresolved externals	D:\VCMI\vcmi\AI\VCAI.dll
Error	13	error LNK1120: 7 unresolved externals	D:\VCMI\vcmi\VCMI_server.exe
Error	29	error LNK1120: 8 unresolved externals	D:\VCMI\vcmi\VCMI_client.exe
Error	9	error LNK2001: unresolved external symbol "__declspec(dllimport) private: class std::shared_ptr<struct CTypeList::TypeDescriptor> __thiscall CTypeList::registerType(class type_info const *)" (__imp_?registerType@CTypeList@@AAE?AV?$shared_ptr@UTypeDescriptor@CTypeList@@@std@@PBVtype_info@@@Z)	D:\VCMI\vcmi\server\CGameHandler.obj
Error	16	error LNK2001: unresolved external symbol "__declspec(dllimport) private: class std::shared_ptr<struct CTypeList::TypeDescriptor> __thiscall CTypeList::registerType(class type_info const *)" (__imp_?registerType@CTypeList@@AAE?AV?$shared_ptr@UTypeDescriptor@CTypeList@@@std@@PBVtype_info@@@Z)	D:\VCMI\vcmi\AI\VCAI\VCAI.obj
Error	23	error LNK2001: unresolved external symbol "__declspec(dllimport) private: class std::shared_ptr<struct CTypeList::TypeDescriptor> __thiscall CTypeList::registerType(class type_info const *)" (__imp_?registerType@CTypeList@@AAE?AV?$shared_ptr@UTypeDescriptor@CTypeList@@@std@@PBVtype_info@@@Z)	D:\VCMI\vcmi\client\Client.obj
Error	7	error LNK2001: unresolved external symbol "__declspec(dllimport) private: class std::vector<class std::shared_ptr<struct CTypeList::TypeDescriptor>,class std::allocator<class std::shared_ptr<struct CTypeList::TypeDescriptor> > > __thiscall CTypeList::castSequence(class type_info const *,class type_info const *)const " (__imp_?castSequence@CTypeList@@ABE?AV?$vector@V?$shared_ptr@UTypeDescriptor@CTypeList@@@std@@V?$allocator@V?$shared_ptr@UTypeDescriptor@CTypeList@@@std@@@2@@std@@PBVtype_info@@0@Z)	D:\VCMI\vcmi\server\CGameHandler.obj
Error	14	error LNK2001: unresolved external symbol "__declspec(dllimport) private: class std::vector<class std::shared_ptr<struct CTypeList::TypeDescriptor>,class std::allocator<class std::shared_ptr<struct CTypeList::TypeDescriptor> > > __thiscall CTypeList::castSequence(class type_info const *,class type_info const *)const " (__imp_?castSequence@CTypeList@@ABE?AV?$vector@V?$shared_ptr@UTypeDescriptor@CTypeList@@@std@@V?$allocator@V?$shared_ptr@UTypeDescriptor@CTypeList@@@std@@@2@@std@@PBVtype_info@@0@Z)	D:\VCMI\vcmi\AI\VCAI\VCAI.obj
Error	21	error LNK2001: unresolved external symbol "__declspec(dllimport) private: class std::vector<class std::shared_ptr<struct CTypeList::TypeDescriptor>,class std::allocator<class std::shared_ptr<struct CTypeList::TypeDescriptor> > > __thiscall CTypeList::castSequence(class type_info const *,class type_info const *)const " (__imp_?castSequence@CTypeList@@ABE?AV?$vector@V?$shared_ptr@UTypeDescriptor@CTypeList@@@std@@V?$allocator@V?$shared_ptr@UTypeDescriptor@CTypeList@@@std@@@2@@std@@PBVtype_info@@0@Z)	D:\VCMI\vcmi\client\Client.obj
Error	11	error LNK2001: unresolved external symbol "__declspec(dllimport) private: virtual void __thiscall CGDwelling::blockingDialogAnswered(class CGHeroInstance const *,unsigned int)const " (__imp_?blockingDialogAnswered@CGDwelling@@EBEXPBVCGHeroInstance@@I@Z)	D:\VCMI\vcmi\server\CVCMIServer.obj
Error	17	error LNK2001: unresolved external symbol "__declspec(dllimport) private: virtual void __thiscall CGDwelling::blockingDialogAnswered(class CGHeroInstance const *,unsigned int)const " (__imp_?blockingDialogAnswered@CGDwelling@@EBEXPBVCGHeroInstance@@I@Z)	D:\VCMI\vcmi\AI\VCAI\VCAI.obj
Error	24	error LNK2001: unresolved external symbol "__declspec(dllimport) private: virtual void __thiscall CGDwelling::blockingDialogAnswered(class CGHeroInstance const *,unsigned int)const " (__imp_?blockingDialogAnswered@CGDwelling@@EBEXPBVCGHeroInstance@@I@Z)	D:\VCMI\vcmi\client\Client.obj
Error	27	error LNK2001: unresolved external symbol "__declspec(dllimport) public: bool __thiscall TerrainTile::hasFavorableWinds(void)const " (__imp_?hasFavorableWinds@TerrainTile@@QBE_NXZ)	D:\VCMI\vcmi\client\mapHandler.obj
Error	12	error LNK2001: unresolved external symbol "__declspec(dllimport) public: class boost::any __thiscall CTypeList::castShared(class boost::any,class type_info const *,class type_info const *)const " (__imp_?castShared@CTypeList@@QBE?AVany@boost@@V23@PBVtype_info@@1@Z)	D:\VCMI\vcmi\server\CVCMIServer.obj
Error	18	error LNK2001: unresolved external symbol "__declspec(dllimport) public: class boost::any __thiscall CTypeList::castShared(class boost::any,class type_info const *,class type_info const *)const " (__imp_?castShared@CTypeList@@QBE?AVany@boost@@V23@PBVtype_info@@1@Z)	D:\VCMI\vcmi\AI\VCAI\VCAI.obj
Error	25	error LNK2001: unresolved external symbol "__declspec(dllimport) public: class boost::any __thiscall CTypeList::castShared(class boost::any,class type_info const *,class type_info const *)const " (__imp_?castShared@CTypeList@@QBE?AVany@boost@@V23@PBVtype_info@@1@Z)	D:\VCMI\vcmi\client\Client.obj
Error	28	error LNK2001: unresolved external symbol "__declspec(dllimport) public: class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall CGameInfoCallback::getTavernRumor(class CGObjectInstance const *)const " (__imp_?getTavernRumor@CGameInfoCallback@@QBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PBVCGObjectInstance@@@Z)	D:\VCMI\vcmi\client\GUIClasses.obj
Error	8	error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned short __thiscall CTypeList::getTypeID(class type_info const *,bool)const " (__imp_?getTypeID@CTypeList@@QBEGPBVtype_info@@_N@Z)	D:\VCMI\vcmi\server\CGameHandler.obj
Error	15	error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned short __thiscall CTypeList::getTypeID(class type_info const *,bool)const " (__imp_?getTypeID@CTypeList@@QBEGPBVtype_info@@_N@Z)	D:\VCMI\vcmi\AI\VCAI\VCAI.obj
Error	22	error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned short __thiscall CTypeList::getTypeID(class type_info const *,bool)const " (__imp_?getTypeID@CTypeList@@QBEGPBVtype_info@@_N@Z)	D:\VCMI\vcmi\client\Client.obj
Error	10	error LNK2001: unresolved external symbol "__declspec(dllimport) public: void * __thiscall CTypeList::castRaw(void *,class type_info const *,class type_info const *)const " (__imp_?castRaw@CTypeList@@QBEPAXPAXPBVtype_info@@1@Z)	D:\VCMI\vcmi\server\CGameHandler.obj
Error	19	error LNK2001: unresolved external symbol "__declspec(dllimport) public: void * __thiscall CTypeList::castRaw(void *,class type_info const *,class type_info const *)const " (__imp_?castRaw@CTypeList@@QBEPAXPAXPBVtype_info@@1@Z)	D:\VCMI\vcmi\AI\VCAI\VCAI.obj
Error	26	error LNK2001: unresolved external symbol "__declspec(dllimport) public: void * __thiscall CTypeList::castRaw(void *,class type_info const *,class type_info const *)const " (__imp_?castRaw@CTypeList@@QBEPAXPAXPBVtype_info@@1@Z)	D:\VCMI\vcmi\client\Client.obj
Error	6	error LNK2001: unresolved external symbol "__declspec(dllimport) public: void __thiscall CPrivilagedInfoCallback::getTilesInRange(class std::unordered_set<class int3,struct ShashInt3,struct std::equal_to<class int3>,class std::allocator<class int3> > &,class int3,int,class boost::optional<class PlayerColor>,int,bool)const " (__imp_?getTilesInRange@CPrivilagedInfoCallback@@QBEXAAV?$unordered_set@Vint3@@UShashInt3@@U?$equal_to@Vint3@@@std@@V?$allocator@Vint3@@@4@@std@@Vint3@@HV?$optional@VPlayerColor@@@boost@@H_N@Z)	D:\VCMI\vcmi\server\CGameHandler.obj

Probably missing include(s).

cannot convert from ‘CGTownInstance *’ to ‘CGObjectInstance *’ = missing includes (need both complete types)

Error    9    error LNK2001: unresolved external symbol "__declspec(dllimport) private: class std::shared_ptr<struct CTypeList::TypeDescriptor> __thiscall CTypeList::registerType(class type_info const *)" (__imp_?registerType@CTypeList@@AAE?AV?$shared_ptr@UTypeDescriptor@CTypeList@@@std@@PBVtype_info@@@Z)    D:\VCMI\vcmi\server\CGameHandler.obj 

This one (and similar) is weird - please try full rebuild.

Once I fixed 1st error, everything linked correctly. Thanks.

Please do not use constexpr. My MSVS 2013 doesn’t support it, besides in current examples it stands just for simple const keyword.

fixed

I can’t link Filestream.cpp. The line

fill_fopen64_filefunc(&MinizipFilefunc);

Seem to use function from other project minizip.

However, when I add MINIZIP_EXPORT to fill_fopen64_filefunc definition, I get crash at launch - no such procedure found in minizip.dll.

How is that supposed to be linked together?

Look like fill_fopen64_filefunc should have also “extern” modifier. (No idea how it work in my case.)

Didn’t work :frowning:

Also, why do we use 64-bit (?) function in first place when there’s alternative? VCMI is 32-bit application.

64bit zip is nothing about 64bit OS. Actually minizip will use “64bit” functions internally anyway.

Then do hardcore :slight_smile: Just copy ioapi functions from ioapi.c to FileStream.cpp. FileIO will be rewritten in MapFormat branch anyway.

Warmonger, lets make develop branch history linear. Please do not merge upstream develop to your local develop use pull fast-forward only or rebase local changes.

What about merging develop into branches?

Tried Ivan’s serialization branch:

Error	2	error C2280: 'std::unique_ptr<T,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function	C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\vector	2144
Error	3	error C2280: 'std::unique_ptr<T,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function	C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0	611
Error	4	error C2280: 'std::unique_ptr<T,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function	C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0	611
Error	5	error C2280: 'std::unique_ptr<T,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function	C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0	611
Error	6	error C2280: 'std::unique_ptr<T,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function	C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0	611
Error	7	error C2280: 'std::unique_ptr<T,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function	C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0	611
Error	8	error C2280: 'std::unique_ptr<T,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function	C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0	611
Error	9	error C2280: 'std::unique_ptr<T,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function	C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0	611
Error	10	error C2280: 'std::unique_ptr<T,std::default_delete<_Ty>>::unique_ptr(const std::unique_ptr<_Ty,std::default_delete<_Ty>> &)' : attempting to reference a deleted function	C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xmemory0	611

Not very informative. Here’s compilation log:

pastebin.com/hSRE1vVG

This is different question.(Also, I do not care about branches.) As for me I rebase small and my own branches and merge large long-term branches and branches with more than one contributor.

I recently tried to compile VCMI via MinGW/CMake and encountered this error:

  1%] Built target minizip
  1%] Building CXX object lib/CMakeFiles/vcmi.dir/filesystem/FileStream.cpp.obj

D:\C++\VCMI_BUILD\VCMI\Source\lib\filesystem\FileStream.cpp: In function 'void* fopen64_file_func(voidpf, const void*, int)':
D:\C++\VCMI_BUILD\VCMI\Source\lib\filesystem\FileStream.cpp:22:58: error: 'fopen64' was not declared in this scope
 #define FOPEN_FUNC(filename, mode) fopen64(filename, mode)
                                                          ^
D:\C++\VCMI_BUILD\VCMI\Source\lib\filesystem\FileStream.cpp: In function 'fpos_t ftell64_file_func(voidpf, voidpf)':
D:\C++\VCMI_BUILD\VCMI\Source\lib\filesystem\FileStream.cpp:23:44: error: 'ftello64' was not declared in this scope
 #define FTELLO_FUNC(stream) ftello64(stream)
                                            ^
D:\C++\VCMI_BUILD\VCMI\Source\lib\filesystem\FileStream.cpp: In function 'long int fseek64_file_func(voidpf, voidpf, fpos_t, int)':
D:\C++\VCMI_BUILD\VCMI\Source\lib\filesystem\FileStream.cpp:24:76: error: 'fseeko64' was not declared in this scope
 #define FSEEKO_FUNC(stream, offset, origin) fseeko64(stream, offset, origin)
                                                                            ^
lib\CMakeFiles\vcmi.dir\build.make:357: recipe for target 'lib/CMakeFiles/vcmi.dir/filesystem/FileStream.cpp.obj' failed
mingw32-make[2]: *** [lib/CMakeFiles/vcmi.dir/filesystem/FileStream.cpp.obj] Error 1
CMakeFiles\Makefile2:139: recipe for target 'lib/CMakeFiles/vcmi.dir/all' failed
mingw32-make[1]: *** [lib/CMakeFiles/vcmi.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
mingw32-make: *** [all] Error 2

Is there a way to fix it?

I think update MinGW is the only solution. What is your versions of MinGW itself and gcc?

I’m currently using gcc 5.1.0, but if there is newer version I’ll certainly update it, thanks.
BTW, I didn’t install Qt5 package, which is needed just by launcher (if I’m not mistaken), and version 5.1.0 of gcc seems to be still the latest one for windows.