Thank you for setting me on the right track. That was it. Actually there 
were a couple of similar issues but they were all related to stuff being 
already defined before kj and capnp. Here (for posterity) is what I had to 
do:

In my PCH for the Unreal project:

// Changes to allow Cap'n Proto headers to compile
//Include\kj/debug.h(505): error C4800: 'int': forcing value to bool 'true' 
or 'false' (performance warning)
#pragma warning(disable:4800)
#include <kj/windows-sanity.h>

also, in classes that used the message types I had to (as you said) #undef 
VOID and also with the example schema #undef MOBILE in one class. I have a 
Python client that's sending messages to Actors in the game (each on their 
own port)... so success. 

Thanks again.

On Friday, May 12, 2017 at 9:20:02 PM UTC-4, Raymond Pendergraph wrote:
>
> I'm trying to get Cap'n Proto 0.6.0 compiled as a plugin under 
> UnrealEngine 4.13 using Visual Studio 2015 (update 3). I have compiled this 
> version under Visual Studio from source. To test, if I create just a plain 
> C++ project and use the installed Cap'n headers and libraries I can 
> generate test message classes that seem to compile with a few compiler 
> warnings. However when compiling an Unreal Project (or a Win32 project) 
> with these same classes I get all sorts of strange errors in kj and cap'n 
> (common.h, etc.) as it imports the header files. My best guess is that it 
> has something to do with the precompiled headers in those environments? 
> Does anyone have a clue or have any advice using Cap'n Proto under Unreal 
> Engine/ Windows?
>
> Example of the errors:
>
> thirdparty\capnproto\include\capnp\common.h(64): error C2628: 
> 'capnp::Void' followed by 'void' is illegal (did you forget a ';'?)
> thirdparty\capnproto\include\capnp\common.h(64): error C2513: 
> 'capnp::Void': no variable declared before '='
> thirdparty\capnproto\include\capnp\common.h(96): error C2062: type 'void' 
> unexpected
> thirdparty\capnproto\include\capnp\common.h(106): error C2143: syntax 
> error: missing ';' before '}'
> thirdparty\capnproto\include\capnp\common.h(130): error C2065: 'Void': 
> undeclared identifier
> thirdparty\capnproto\include\capnp\common.h(130): error C2923: '_::Kind_': 
> 'Void' is not a valid template type argument for parameter 'T'
> thirdparty\capnproto\include\capnp\common.h(130): error C2913: explicit 
> specialization; '_::Kind_' is not a specialization of a class template
> thirdparty\capnproto\include\capnp\common.h(131): error C2913: explicit 
> specialization; '_::Kind_' is not a specialization of a class template
>
> I can include these  headers in an "empty project" and compile these 
> classes fine so I'm not sure what the deal is.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to