Comments (8)
Hi,
afaik, the C4647 error should be gone if you do step 2 in the guide (comment out "static_assert(std::is_pod::value, "");".
I ignored the 4800 error with the by ignoring it with a pragma (see step 7).
Be aware that you have to add the "pragma warning (disable ...)" in each of your pb.h file.
Currently, we are facing more problems. For more info see: protocolbuffers/protobuf#4129
Best,
Florian
from libprotobuf_ue4.
Same here. Have you found a solution for this issue, @NelsonBilber ?
from libprotobuf_ue4.
Not really ... the only version that I can make work was 3.2.0.
After generate visual studio solution I need to change the projects settings on C++ -> code generation to Multi-threaded DLL (/MD)
Then when generate files with protoc on filles *.pb.cc
I also have to disable some warning in order to compile project
Example:
Add these pragmas on protobuff generated files " *.pb.cc " on the top of file
//...
pragma warning(push)
#pragma warning(disable : 4668) // warning C4668: A symbol that was not defined was used with a preprocessor directive. The symbol will evaluate to false
//...
Don't forget on unreal project source code to include theses
#include "AllowWindowsPlatformTypes.h"
//...
#iinclude "...*.pb.cc "
//..
#include "HideWindowsPlatformTypes.h"
I'm not complete confident that is robust lets see during development if it's a stable solution
Regards
from libprotobuf_ue4.
Was able to compile it successfully. Here are my steps:
https://medium.com/@0xflarion/using-ue4-w-google-protocol-buffers-ae7cab820d84
from libprotobuf_ue4.
@fweidner Any chance of a pull request (thanks for the blog post by the way!)
from libprotobuf_ue4.
@aaronsnoswell i did not base my code on this repo (yet). I'll try to reproduce it next week and will create a pull request.
from libprotobuf_ue4.
@fweidner any update on this? I tried to compile this project with protobuf 3.5 but I get several error messages:
- Complie Protobuf 3.5 via your guide
- Copy and replace the lib files into the plugin folder
- Update the Protobuf submodule to 3.5
- Changed to libprotobuf.Build.cs to:
// Copyright 2016 Code 4 Game. All Rights Reserved.
using System.IO;
using System;
using UnrealBuildTool;
public class libprotobuf : ModuleRules
{
public libprotobuf(TargetInfo Target)
{
Type = ModuleType.External;
bool is_supported = false;
if ((Target.Platform == UnrealTargetPlatform.Win32) || (Target.Platform == UnrealTargetPlatform.Win64))
{
is_supported = true;
string vs_path = "vs"
+ WindowsPlatform.GetVisualStudioCompilerVersionName()
+ ((Target.Platform == UnrealTargetPlatform.Win64) ? "win64" : "");
string protobuf_lib_directory_full_path = System.IO.Path.Combine(ModuleDirectoryFullPath, "lib", vs_path);
PublicLibraryPaths.Add(protobuf_lib_directory_full_path);
PublicAdditionalLibraries.Add("libprotobuf.lib");
Definitions.AddRange(
new string[]
{
((Target.Platform == UnrealTargetPlatform.Win64) ? "WIN64" : "WIN32"),
"_WINDOWS",
"NDEBUG",
"GOOGLE_PROTOBUF_CMAKE_BUILD",
});
}
if (is_supported)
{
string protobuf_code_directory_full_path = System.IO.Path.Combine(ModuleDirectoryFullPath, "protobuf", "src");
PublicSystemIncludePaths.Add(protobuf_code_directory_full_path);
}
LoadGoogleProtocolBuffers(Target);
}
string ModuleDirectoryFullPath
{
get { return System.IO.Path.GetFullPath(ModuleDirectory); }
}
public bool LoadGoogleProtocolBuffers(TargetInfo Target)
{
bool isLibrarySupported = false;
if ((Target.Platform == UnrealTargetPlatform.Win64)){
isLibrarySupported = true;
string LibrariesPath = Path.Combine(ThirdPartyPath, "libprotobuf", "lib");
Console.WriteLine("... LibrariesPath -> " + LibrariesPath);
PublicAdditionalLibraries.Add(Path.Combine(LibrariesPath, "libprotobufd" + ".lib"));
}
if (isLibrarySupported){
string IncludePath= Path.Combine(ThirdPartyPath, "libprotobuf", "include");
Console.WriteLine("... IncludePath -> " + IncludePath);
PrivateIncludePaths.Add(IncludePath); }
Definitions.Add(string.Format("WITH_GPB_BINDING={0}", isLibrarySupported ? 1 : 0));
return isLibrarySupported;
}
private string ModulePath
{
get { return ModuleDirectory; }
}
private string ThirdPartyPath
{
get { return Path.GetFullPath(Path.Combine(ModulePath, "../../ThirdParty/")); }
}
}
//Error messages when compiling my game
Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand
Fehler C4800 "google::protobuf::internal::Atomic64": Variable wird auf booleschen Wert ("True" oder "False") gesetzt (Auswirkungen auf Leistungsverhalten möglich) Community C:\Users\Eli\Code\Unreal\Community\Source\ThirdParty\libprotobuf\protobuf\src\google\protobuf\io\coded_stream.h 857
Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand
Fehler C4647 Verhaltensänderung: __is_pod(google::protobuf::internal::AuxillaryParseTableField) hat in früheren Versionen einen anderen Wert. Community C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE\type_traits 414
Schweregrad Code Beschreibung Projekt Datei Zeile Unterdrückungszustand
Fehler C4541 "dynamic_cast" für polymorphen Typ "google::protobuf::Message" mit /GR- verwendet; unvorhersehbares Verhalten möglich Community C:\Users\Eli\UE4\UE_4.18\Engine\Source\Runtime\CoreUObject\Public\Templates\Casts.h 390 ```
from libprotobuf_ue4.
I was able to build and run latest 3.12.0 protobuf and it looks to be running just fine. I've unchecked MSVC_STATIC_RUNTIME, built and copied includes and lib file into according folders. Let me know if you get some questions. Also when going more complicated protocols - you need to suppress some warnings, otherwise it wont compile
from libprotobuf_ue4.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libprotobuf_ue4.