Unreal Engine 4.22 Could not find definition for module - c#

I'm taking a course for Unreal Engine 4 and I seem to have run into a compilation error.
I only have maybe 3 days experience with Unreal.
I am an expert at C++.
I have never touched C Sharp before which is why it is irritating that C Sharp is being used in small parts of the example project when I was promised that only C++ is used in Unreal Engine 4 projects.
The logfile ends as follows:
LogVSAccessor: Warning: Couldn't access Visual Studio
Candidate modules for hot reload:
BullCowGame
Launching UnrealBuildTool... [C:/Program Files/Epic Games/UE_4.22/Engine/Binaries/DotNET/UnrealBuildTool.exe -ModuleWithSuffix=BullCowGame,6263 Win64 Development -TargetType=Editor -Project="C:/Users/school/Desktop/unreal_course_projects/bull_cow_game_attempt_2/BullCowGame-starter-kit/BullCowGame.uproject" "C:/Users/school/Desktop/unreal_course_projects/bul
l_cow_game_attempt_2/BullCowGame-starter-kit/BullCowGame.uproject" -IgnoreJunk]
Warning: Starting HotReload took 1.5s.
CompilerResultsLog: New page: Compilation - May 6, 2020, 9:08:11 PM
CompilerResultsLog: Using 'git status' to determine working set for adaptive non-unity build (C:\Users\school\Desktop\unreal_course_projects\bull_cow_game_attempt_2\BullCowGame-starter-kit).
CompilerResultsLog: Creating makefile for BullCowGameEditor (game project files are newer)
CompilerResultsLog: ERROR: Could not find definition for module 'BullCowGame' (referenced via BullCowGameEditor.Target.cs)
LogMainFrame: MainFrame: Module compiling took 37.379 seconds
Warning: HotReload failed, recompile failed
LogSlate: Window 'Message Log' being destroyed
LogSlate: Window 'Message Log' being destroyed
BullCowGameEditor.Target.cs:
// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool;
using System.Collections.Generic;
public class BullCowGameEditorTarget : TargetRules
{
public BullCowGameEditorTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Editor;
ExtraModuleNames.AddRange( new string[] { "BullCowGame" } );
}
}
BullCowGame.Target.cs:
// Fill out your copyright notice in the Description page of Project Settings.
using UnrealBuildTool;
using System.Collections.Generic;
public class BullCowGameTarget : TargetRules
{
public BullCowGameTarget(TargetInfo Target) : base(Target)
{
Type = TargetType.Game;
ExtraModuleNames.AddRange( new string[] { "BullCowGame" } );
}
}
The project layout:
The error I'm trying to fix: ERROR: Could not find definition for module 'BullCowGame' (referenced via BullCowGameEditor.Target.cs)
You can see this error towards the bottom of the log file.
Has anyone seen this before?
Thanks in advance

Looking at your project layout, you are missing .../Source/BullCowGame/BullCowGame.Build.cs which describes how to build the BullCowGame module.
See: https://docs.unrealengine.com/en-US/ProductionPipelines/BuildTools/UnrealBuildTool/ModuleFiles/index.html

Related

Why is the Namespace "IUnityRenderPipeline" Suddenly Missing from the Vuforia Script?

I've been working in Unity the last month or so. I've gotten a few iterations of a basic AR application worked up but I've updated Unity and now my code is throwing all sorts of errors.
Last week my app was working fine when building to my Pixel phone. Now that I've updated to Unity 2018.3.9, Vuforia 8.1 is now missing the name space mentioned in the title. Does anyone have any information on this?
The app will play correctly if I restart Unity up until I try to build the application to the phone. Once I build and it fails I can't replay the application due to compiler errors.
I've typed in different namespaces in the Vuforia Script and have checked my script. Mine is the same script I've used in previous versions with zero issues. I have Vuforia in the namespace but the issue appears to be coming form the Vuforia inherent script instead.
Here's the section of the Vuforia Code that appears to have the most bugs:
\\\\
namespace Vuforia.UnityCompiled
{
public class RuntimeOpenSourceInitializer
{
static IUnityCompiledFacade sFacade;
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
static void OnRuntimeMethodLoad()
{
InitializeFacade();
}
static void InitializeFacade()
{
if (sFacade != null) return;
sFacade = new OpenSourceUnityCompiledFacade();
UnityCompiledFacade.Instance = sFacade;
}
class OpenSourceUnityCompiledFacade : IUnityCompiledFacade
{
readonly IUnityRenderPipeline mUnityRenderPipeline = new UnityRenderPipeline();
public IUnityRenderPipeline UnityRenderPipeline
{
get { return mUnityRenderPipeline; }
}
}
class UnityRenderPipeline : IUnityRenderPipeline
{
public event Action<Camera[]> BeginFrameRendering;
public event Action<Camera> BeginCameraRendering;
public UnityRenderPipeline()
\\\\\
I'm not versed enough in C# to know the fine tunings of QC'ing the code other than the immediate lack of ";" in a lot of these lines.
What the app should be doing is building correctly to my phone. Once there it's an application that reads a sketch I drew, and shows a model or several renderings of the space based on the image target and virtual buttons placed in Unity.
Hello
Not sure how you created your app, but these errors look similar to ones you'd get if there was a mismatch between the Engine SDK version and the Vuforia samples. As the SDK evolves and APIs are created/changes, so do the samples to be compatible with them. Here's how you can check the versions of both (assuming you used Vuforia samples resources):
- SDK version: Unity Editor->Window->Vuforia Configuration.
- Samples version: Unity Editor->Project window: Assets/Vuforia/version.
also, you can delete the old version of Vuforia and re-import from the Package Manager in Unity.
Thanks,

clang Error: Linker Command Failed for Unity in Native

My project is Unity in Native integration, had problem with clang error: Build failed refer image. I had gone through other sources in stack overflow to clear with clang error. I tried to remove my main.mm file, then build get succeeded but app will crash when calling unity screen. So I have to keep both files AppDelgate and main.mm file. Couldn't fix this....issue. if anyone could please..
Based on your question, hope that it's unity in swift native integration.
NOTE: This solution is only for case: Unity in Native iOS
From your screen shot it show that you are using 2 main files in Xcode. There are 2 options to fix this out.
Option 1) you may keep both files in Build Phases --> Compile sources , but in your AppDelegate, command #UIApplicationMain
import UIKit
//#UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
.......................................}
This will build succeeded and unity view appears at initial stage.
Option 2) If you want to show unity view with button, Remove your main.mm file from Build Phases --> Compile sources, so app won't crash in unity view by using 'shared window appDelegate' and try this code in your AppDelegate (uncommand #UIApplicationMain)
func unityWindow() -> UIWindow? {
return UnityGetMainWindow()
}
func showUnityWindow() {
unityWindow()?.makeKeyAndVisible()
}
func hideUnityWindow() {
window!.makeKeyAndVisible()
}
then, in your View Controller
private var isShowUnityWindow = false
override func viewDidLoad()
{
super.viewDidLoad()
isShowUnityWindow = false
}
#IBAction func startUnityandHide(_ sender: UIButton)
{
isShowUnityWindow = !isShowUnityWindow
var appDelegate = UIApplication.shared.delegate as? AppDelegate
if isShowUnityWindow {
appDelegate?.unityWindow()!.frame = CGRect(x: 40, y: 200, width: 300, height: 300)
appDelegate?.showUnityWindow()
} else {
appDelegate?.hideUnityWindow()
}
}

How to integrate the unity ios project into native ios swift project?

I've tried most of the online resources including this link too to integrate my unity project into swift 4 native project but unfortunately not helped until now. When I do Linked fix I got into below c++ file error:
No member named 'GetHostByAddr40' in 'il2cpp::icalls::System::System::Net::Dns'; did you mean 'GetHostByAddr'?
Btw I am actually doing a augmented reality project which having some native iOS designs too. Since so I've done those parts using swift 4 with Xcode 9.2. The native part contains the project's start and the end part. In between that, there is augmented reality part which is done by using unity 2018.2.0f2 personal and vofuria 7.2.23.
In the end, now I have an iOS native project and unity project. I wanted to integrate the unity part into iOS native!
After a long search, I get ride the error.
After fixing with this described solutions, I've ended up with Bulk_Mono.Security_1.cpp file not found. So I've started to search for it. Then I've got identified the problem. The problem is with 4.0 Scripting runtime version of .Net. I made the project with 4.0 because of the use of LitJson requires min 4.0. The 4.0 is not generating the Bulk_Mono.Security_1.cpp file for iOS. Then I've removed the LitJson from the project and downgraded the project runtime version to 3.x Equivalent and it started to work fine with the changes on the following 2 files.
Note that just integrate the generated objective-c project as like a framework usually then make following changes and run.
made the change following on DisplayManager.mm generated file which is located in classes/unity. The auto-generated not contains the last line of return deviceUnknown;. So we have to write manually.
elif PLATFORM_TVOS
if (!strncmp(model, "AppleTV5,", 9))
return deviceAppleTV1Gen;
else if (!strncmp(model, "AppleTV6,", 9))
return deviceAppleTV2Gen;
else
return deviceUnknown;
endif
return deviceUnknown
Do the following change on SplashScreen.mm which is located in generated project's classes/ui. Change the bool hasStoryboard = [[NSBundle mainBundle] pathForResource: #"LaunchScreen" ofType: #"storyboardc"] != nullptr; to bool hasStoryboard = [[NSBundle mainBundle] pathForResource: #"LaunchScreen_1" ofType: #"storyboardc"] != nullptr;. The complete method below.
void ShowSplashScreen(UIWindow* window)
{
bool hasStoryboard = [[NSBundle mainBundle] pathForResource: #"LaunchScreen_1" ofType: #"storyboardc"] != nullptr;
if (hasStoryboard)
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:
#"LaunchScreen" bundle: [NSBundle mainBundle]];
_controller = [storyboard
instantiateViewControllerWithIdentifier: #"unitySplashStoryboard"];
}
else
_controller = [[SplashScreenController alloc] init];
[_controller create: window];
[window makeKeyAndVisible];
}
That's all about how I integrated.

Can't step Into and debug the serviced component source code

I have developed a COM+ Component in C# be inheriting ServicedComponent.
Here is how it looks like:
[Transaction(TransactionOption.Required)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[EventTrackingEnabledAttribute(true)]
[JustInTimeActivation]
[ObjectPooling(Enabled = true, MinPoolSize = 10, MaxPoolSize = 30, CreationTimeout = 15000)]
[Synchronization]
class MyComponent: System.EnterpriseServices.ServicedComponent
{
[AutoComplete(true)]
public string getHello()
{//2nd breakpoint
ContextUtil.SetComplete();
return "HelloWorld";
}
}
I have another test project from which I call this component.
class Program
{
static void Main(string[] args)
{
MyComponent myComp = new MyComponent();
myComp.getHello();//1st Breakpoint
}
}
I am not able to reach 2nd Breakpoint. This was working before I switched to VS 2012. Strange thing is after switching to 2012 its no longer working in VS 2010 too.
I've already tried,
Attach to process
Unchecked "Enable Just My Code" in debug settings
Can someone please give direction from here?
UPDATE 1
From the links given by Mike, I tried symchk for my DLL in the same folder where DLL and PDB files were there. It fails with error saying PDB mismatched or not found. I don't know how to resolve this error.
You may be missing the .pdb file in your project.
Check this microsoft link out for an explanation: https://msdn.microsoft.com/en-us/library/yd4f8bd1(vs.71).aspx

WinDbg and .Net x64 Assembly : Step-By-Step Walkthrough for hitting a breakpoint in a C# source

I am having very hard times using WinDbg to track a simple object reference in a C# Forms App.
I have found a very nice tuto by Chris Lovett : GCRoot Demo on using "SOS" in VS' Immediate Window
Unfortunately, I am debugging an x64 App and recompiling my App into 32-bit will bias the test conditions I am willing to recreate. Trying to load SOS in an x64 Assembly results, as expected, in the following error :
Error during command: extension C:\Windows\Microsoft.NET\Framework64\v4.0.30319\sos.dll could not load (error 193)
So, as WinDbg seems to manage x64, that's the way to go for me. However, getting it to work with managed code is not a straightforward task.
Putting a simple breakpoint into the attached source results, unsurprisingly, into the following error :
Unable to insert breakpoint 0 at 00000000 010e000f, Win32 error 0n998
"Invalid access to memory location."
This is consistent with the guidelines given by Naveen Srinivasan.on his Blog
However, when I try to use the ” sxe ld” / “.loadby sos” / ”.load sosex" workarounds suggested in that same web page, I get the following error :
The call to LoadLibrary(sos) failed, Win32 error 0n2
The system cannot find the file specified.
So I guess the latter commands are also SOS-related
I have also tried to follow an older post from Eran Sandler which explains exactly how to proceed to set a breakpoint in WinDbg for Managed Code. But I am suspecting the name2ee command he is using to be "SOS" specific, thus making it rather unusable in my case (I am getting same kind of LoadLibrary error).
I am really confused and helpless here. I feel I am bumping on walls whatever direction I take. I am two inches far from giving up and recompiling the whole App into 32-bit to debug it, as I've already lost almost 2 working days on this.
All this is only the first step towards what I want to achieve, which is to track all the references to a "Trackee" object in a more complex App, using gcroot.
Than you for your help.
Dummy Sample code : DebugTest.cs :
namespace DebugTest
{
public partial class Form1 : Form
{
String Trackee;
public Form1()
{
InitializeComponent();
Trackee = "Where is Charlie";
}
private void button1_Click(object sender, EventArgs e)
{
label1.Text = Trackee; // << Trying to put a breakpoint here
}
}
}
ANSWER : Walkthrough
1 - "loadby sos.dll clr" makes it possible to call all SOS stuff. (including "name2ee" command to follow Eran Sandler's steps.)
2 - The following command puts a breakpoint efficiently into the Managed code of some method. Example:
!bpmd DebugTEst.exe DebugTest.Form1.button1_Click
3 - I am still unable to have a real visual debugger behavior as break point is hit logically as shown in the command window, but not visually in source window.
4 - By affecting to Trackee a specific Type (MyString, for ex.) I was able to track the Object's adress using !DumpHeap -type myString
which give the following ouput :
Address MT Size
0000000002bd33e0 000007ff000581d0 24
5 - Then after performing a load vgcroot and !vgcroot 0000000002bd33e0 C:\graph.dgml I was able to find and visualize all the references to my Trackee.

Categories