Can't include Networking.h in actor header

I’m following this tutorial on creating an UDP receiver and sender in C++: [UDP Socket Sender Receiver From One UE4 Instance To Another][1].

I’ve got a problem with including a “Networking.h” header in my actor. When I add it on top of my actor header I get an error at UCLASS() makro: “this declaration has no storage class or type specifier”. With variables I can just put “class” keyword before the types from Networking.h and include it in .cpp file, but it doesn’t work for function parameters. Does anyone know why this include doesn’t work in .h but works in .cpp? Maybe there is a workaround that allows me to use a type from Networking.h to be included in function declaration?


Compile it, it should work. VS Intellisense at its best again I guess :stuck_out_tongue_winking_eye:

If you get Compiler Errors pls let me know and post them.

I wouldn’t write a question without trying to compile it :wink: here are errors I get

Thats the Error Log not the Output Log =) anyway it says you have declared a Function twice? Nothing about a wrong include or linker error.

Well, I’ve removed the linker error and it compiles actually (it didn’t before even without the linker error), but still got IntelliSense errors all other the place which is ridiculous and my OCD can’t stand it :slight_smile: can I get rid of them somehow?

Sure do it like me. Close the Error log forever and get Visual Assist. Best VS plugin you could ever throw Money at (try the Trial =) also I put my trust in the Output Window only.

I’ll try it soon for sure and thanks for your help :wink: