Compile on VS2013

Here you can post threads specific to the current release of the core (099)

Moderator: POL Developer

Post Reply
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Compile on VS2013

Post by bodom »

Hi there,

so after some months I'm finally approaching POL099. From what I've learned, the distro is quite old and the suggested release is latest git commit, so I am trying to build the core myself.

I had no problem building it on Linux, but on Windows I've got stuck (that's where I am less familiar with the environment). I have downloaded the sources and Visual Studio 2013 Community (I've tried 2015 at first, but got a huge amount of error with the boost library). I have unpacked boost. Now I am trying to build the solution, but I get many errors. The first error is:
1>c:\polserver\pol-core\pol\dynproperties.h(268): error C2143: syntax error : missing ';' before '<' (listenpt.cpp)
the interested code line is:

Code: Select all

  std::vector<PropHolder<Storage>> _props;
I then have many errors, all similar to this one. I do now know C++, but I've learned to always start by fixing first error and then try again :D

Any hint?
Nando
POL Developer
Posts: 282
Joined: Wed Sep 17, 2008 6:53 pm
Contact:

Re: Compile on VS2013

Post by Nando »

Quick fix: compile for x64.

Slightly longer fix: add the line

Code: Select all

#include <vector>
in dynproperties.h below

Code: Select all

#include <bitset>
#include <string>
#include <type_traits>
This is because x64 compiles using a global header file that includes many common files (vector, string, etc) to speed up compilation. The problem is that this global include hides errors when includes are missing in some files, which you found out by compiling for win32. :P

I'm surprised that neither GCC nor Clang complained about this...

(and it's now corrected in github)
bodom
Former Developer
Posts: 140
Joined: Sat Feb 21, 2015 7:52 pm
Location: Italy

Re: Compile on VS2013

Post by bodom »

It works, thank you Nando!

Now that you tell me, on Linux I've built by default for x64, while on Windows default build seems to be x86.

Going back to study the sources and C++ :bacondance:
Post Reply