Page 1 of 1

Compile on VS2013

Posted: Wed Aug 26, 2015 3:28 am
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?

Re: Compile on VS2013

Posted: Thu Aug 27, 2015 7:12 am
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)

Re: Compile on VS2013

Posted: Thu Aug 27, 2015 8:50 pm
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: