Closed Zifkan closed 6 years ago
First, you shouldn't write v.std::to_string() but std::to_string(v). Then, the UE_LOG, LogTemp, Warning may also cause errors depending how you declare them.
Debugging a template compile error in C++ is super-hard, especially for people coming from .NET world :) .
When you have a compile error and you couldn't understand it, try to remove the offending codes and re-add them little by little and fix the error when it appears. Also, you'd better see the output window (not the error list window). It will show where in your source code the errors originate (in your case, grep your source cpp "MyProjectCharacter.cpp".
Ty for answer, but std::to_string(v) didn't help. Also i removed all test code and still getting error. When i just adding header without code i have this issue
Output:
Did you include rx.hpp ?
#include "rxcpp/rx.hpp"
Yes, i included rx.hpp. Also tried other headers like rx-observable.hpp
Sorry, don't have any more idea. It may be due to your project settings as well. The warning on _CPPRTI is also suspicious.
You should divide and conquer the problem by yourself. For example, create a new console project, and add the rxcpp code.
hi! would you please send the compiler commandline? you should be able to find it in the project settings. I think that perhaps unreal has disabled some compiler features that rxcpp depends on.
Hi. Is this what you asking?
This looks like the debugger command line, I would like to see the compiler command line. I see that there is a node for NMake, that may mean that the compiler command line is not visible in the UX. perhaps if there is a build log it will show the command line for cl.exe?
Oh. i think im not familiar with what you ask. Can't understand. I look for logs but didn't find something usefull. Can you explain pls more in detail what should i provide and how to do this
I found this question that seems to show the answer: https://answers.unrealengine.com/questions/125830/compiler-options.html
specifically, the answer: "Gleb.Bulgakov Nov 11 '14 at 8:11 AM"
However, I do not think that will help.
This appears to be a bug in unreal:
03-18-2016, 09:42 AM The answer is that this is a bug. I've made a bug report linked below. The problem is that Unreal uses a lot of macros with commonplace naming, which leads to them conflicting with Boost, and other library's commonplace object names. It's okay for these libraries' objects to have commonplace naming because the objects obey namespace and scope rules, whereas macros don't. This is why Bjarne Stroustrup has been telling C++ programmers to stop using macros and use templates for nearly 2 decades now. (additional link below)
https://answers.unrealengine.com/que...conflicts.html http://www.stroustrup.com/bs_faq2.html#macro
Thank you very much. May be ill try to realise this like unreal engine plugin
Looks like i resolved problem.
This topic:
https://answers.unrealengine.com/questions/391017/constant-library-conflicts.html
last comment with link to script: https://github.com/hiili/UnrealMacroNuke
This script searching UE headers and redefine Macros. So i have issue with script its didn't generate files. So in resources there are already two generated headers:
"UndefineMacrosUE(version).h" and "RedefineMacrosUE(version).h"
(for example: UndefineMacros_UE_4.18.h" and "RedefineMacros_UE_4.18.h )
Then in my solution wich described at the begging i added one header "RedefineRx.h" with simple code as described in instruction
Im not sure is only rx.hpp as main header need redefenition of macros.
I tested simple code with UE project
auto values1 = rxcpp::observable<>::range(1, 5); values1.subscribe([](int v) { GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, FString::Printf(TEXT("Rx value range: %i"), v)); });
And have result in game:
May be it will help some one
P.S. If im not mistake . It will be great if Rx can be compiled to DLL. It will be way easier way to include this for Unreal engine through UE's Plugin system.
Hi! Has a better solution been found?) If not, please tell me how to run the script, I will be very grateful.
Hi there. Im added files into my game solution(Unreal engine 4 solution) just through menu: add->Existing Item. Then i wrote some simple code for test:
auto values1 = rxcpp::observable<>::range(1, 5); values1.subscribe([](int v) { UE_LOG(LogTemp, Warning, v.std::to_string()); });
Added #include "rxcpp/rx-observable.hpp". When i build im getting errors:
Whats wrong. Im not very familiar with c++. I used rx in .net and now trying with c++