ue4plugins / StreetMap

Import OpenStreetMap data into Unreal Engine
MIT License
2.16k stars 442 forks source link

Can't compile in 4.21.1 Windows 10 #60

Closed etiennasse closed 1 year ago

etiennasse commented 5 years ago

When I lunch a C++ project with the plugin in 4.21.1, it tells me that it can't compile.

Korky commented 5 years ago

repro steps, I'm using release branch and it builds

etiennasse commented 5 years ago

I only have access to the master branch, maybe i'm doing something wrong?

Korky commented 5 years ago

I meant I'm using Unreal's release branch

Korky commented 5 years ago

can I see the error you getting

davedumas0 commented 5 years ago

i am getting this error Severity Code Description Project File Line Suppression State Warning Modules must specify an explicit precompiled header (eg. PrivatePCHHeaderFile = "StreetMapRuntime.h") from UE 4.21 onwards. PFM_NEW C:\Users\dave\Documents\Unreal Projects\PFM_Daves_remake\Plugins\StreetMap\Source\StreetMapRuntime\StreetMapRuntime.Build.cs 1

davedumas0 commented 5 years ago

and Severity Code Description Project File Line Suppression State Error C2504 'UActorFactory': base class undefined PFM_NEW C:\Users\dave\Documents\Unreal Projects\PFM_Daves_remake\Plugins\StreetMap\Source\StreetMapImporting\StreetMapActorFactory.h 9

davedumas0 commented 5 years ago

and a bunch more

Korky commented 5 years ago

so, did you do these steps when adding the plug-in: after you clone the project into the plug-in folder you right click the the .uproject file and hit generate visual studio solution then you go to visual studio and if you already had it open it will detect changes so just reload ... I'll build it again today see if I get the error

NimaGard commented 5 years ago

I had the same problem on Ubuntu and MacOS, and resolved it by adding

include "ActorFactories/ActorFactory.h" to StreetMapActorFactory.h

riemannulus commented 5 years ago

I had same problem, cannot build manually. I'm new to Unreal.

Environment

Windows 10, version 1809 Visual Studio 2017 15.9.7 Unreal Engine 4.21.2 StreetMap 4.19

Step

  1. Create Unreal project(C++).
  2. Open Visual Studio and pre-complie complete Myproject2.
  3. Copy streetmap plugin and paste on {Unreal Project Folder}/Myproject2/Plugins/StreetMap.
  4. Rebuild at Visual Studio.
  5. Popup error.

Error message

Severity    Code    Description Project File    Line    Suppression State
Warning     Modules must specify an explicit precompiled header (eg. PrivatePCHHeaderFile = "StreetMapRuntime.h") from UE 4.21 onwards. MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Source\StreetMapRuntime\StreetMapRuntime.Build.cs 1   
Warning     Modules must specify an explicit precompiled header (eg. PrivatePCHHeaderFile = "StreetMapImporting.h") from UE 4.21 onwards.   MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Source\StreetMapImporting\StreetMapImporting.Build.cs 1   
Error   C2504   'UActorFactory': base class undefined   MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Source\StreetMapImporting\StreetMapActorFactory.h 9   
Error   C3668   'UStreetMapActorFactory::PostSpawnActor': method with override specifier 'override' did not override any base class methods MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Source\StreetMapImporting\StreetMapActorFactory.h 13  
Error   C3668   'UStreetMapActorFactory::PostCreateBlueprint': method with override specifier 'override' did not override any base class methods    MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Source\StreetMapImporting\StreetMapActorFactory.h 14  
Error   C3668   'UStreetMapActorFactory::CanCreateActorFrom': method with override specifier 'override' did not override any base class methods MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Source\StreetMapImporting\StreetMapActorFactory.h 15  
Error   C2440   'return': cannot convert from 'UStreetMapActorFactory *' to 'UObject *' MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Source\StreetMapImporting\StreetMapActorFactory.h 10  
Error   C2039   'StaticConfigName': is not a member of 'UStreetMapActorFactory' MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Intermediate\Build\Win64\UE4Editor\Inc\StreetMapImporting\StreetMapActorFactory.gen.cpp   71  
Error   C3861   'StaticConfigName': identifier not found    MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Intermediate\Build\Win64\UE4Editor\Inc\StreetMapImporting\StreetMapActorFactory.gen.cpp   71  
Error   C2039   'AddReferencedObjects': is not a member of 'UStreetMapActorFactory' MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Intermediate\Build\Win64\UE4Editor\Inc\StreetMapImporting\StreetMapActorFactory.gen.cpp   71  
Error   C2065   'AddReferencedObjects': undeclared identifier   MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Intermediate\Build\Win64\UE4Editor\Inc\StreetMapImporting\StreetMapActorFactory.gen.cpp   71  
Error   C2027   use of undefined type 'UActorFactory'   MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Intermediate\Build\Win64\UE4Editor\Inc\StreetMapImporting\StreetMapActorFactory.gen.cpp   71  
Error   C3083   'WithinClass': the symbol to the left of a '::' must be a type  MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Intermediate\Build\Win64\UE4Editor\Inc\StreetMapImporting\StreetMapActorFactory.gen.cpp   71  
Error   C2437   'Super': has already been initialized   MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Intermediate\Build\Win64\UE4Editor\Inc\StreetMapImporting\StreetMapActorFactory.gen.cpp   73  
Error   LNK2019 unresolved external symbol "__declspec(dllimport) public: static void __cdecl UNavigationSystem::UpdateComponentInNavOctree(class UActorComponent &)" (__imp_?UpdateComponentInNavOctree@UNavigationSystem@@SAXAEAVUActorComponent@@@Z) referenced in function "protected: void __cdecl UStreetMapComponent::ClearCollision(void)" (?ClearCollision@UStreetMapComponent@@IEAAXXZ)   MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Intermediate\ProjectFiles\Module.StreetMapRuntime.cpp.obj   1   
Error   LNK1120 1 unresolved externals  MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Binaries\Win64\UE4Editor-StreetMapRuntime-3736.dll    1   
Error       UBT ERROR: Failed to produce item: C:\Users\riema\Documents\Unreal Projects\MyProject2\Plugins\StreetMap\Binaries\Win64\UE4Editor-StreetMapImporting-3736.dll   MyProject2  C:\Users\riema\Documents\Unreal Projects\MyProject2\Intermediate\ProjectFiles\UnrealBuildTool   1   
Error   MSB3075 The command ""C:\Games\Epic Games\UE_4.21\Engine\Build\BatchFiles\Build.bat" MyProject2Editor Win64 Development "C:\Users\riema\Documents\Unreal Projects\MyProject2\MyProject2.uproject" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command.   MyProject2  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets   44  

Am I miss something? Thanks.

Korky commented 5 years ago

before rebuilding you have to re-generate visual studio project files right clicking the .uproject

riemannulus commented 5 years ago

Thanks for answer, @Korky But, It cause same error.

Step

  1. Goto Myproject2 Project Folder
  2. Right-click Myproject2.uproject and select Generate Visual Studio project file
  3. Wait
  4. Open Myproject3.sln at Visual Studio
  5. Rebuild Solution
  6. Got error message

Screenshot

C:\Users\riema\Documents\Unreal Projects\MyProject3\Plugins\StreetMap

Korky commented 5 years ago

did you also do what NimaGrad said?, sounds like it could be it

riemannulus commented 5 years ago

Thanks for answer.

I did https://github.com/ue4plugins/StreetMap/issues/60#issuecomment-461543423, then I got different error message.

Step

  1. Add #include "ActorFactories/ActorFactory.h" in StreetMap/Source/StreetMapImporting/StreetMapActorFactory.cpp before #include "StreetMapActorFactory.generated.h"
  2. Re-Generate Visual Studio project file
  3. Rebuild

Error Message

Severity    Code    Description Project File    Line    Suppression State
Warning     Modules must specify an explicit precompiled header (eg. PrivatePCHHeaderFile = "StreetMapRuntime.h") from UE 4.21 onwards. MyProject3  C:\Users\riema\Documents\Unreal Projects\MyProject3\Plugins\StreetMap\Source\StreetMapRuntime\StreetMapRuntime.Build.cs 1   
Warning     Modules must specify an explicit precompiled header (eg. PrivatePCHHeaderFile = "StreetMapImporting.h") from UE 4.21 onwards.   MyProject3  C:\Users\riema\Documents\Unreal Projects\MyProject3\Plugins\StreetMap\Source\StreetMapImporting\StreetMapImporting.Build.cs 1   
Error   LNK2019 unresolved external symbol "__declspec(dllimport) public: static void __cdecl UNavigationSystem::UpdateComponentInNavOctree(class UActorComponent &)" (__imp_?UpdateComponentInNavOctree@UNavigationSystem@@SAXAEAVUActorComponent@@@Z) referenced in function "protected: void __cdecl UStreetMapComponent::ClearCollision(void)" (?ClearCollision@UStreetMapComponent@@IEAAXXZ)   MyProject3  C:\Users\riema\Documents\Unreal Projects\MyProject3\Intermediate\ProjectFiles\Module.StreetMapRuntime.cpp.obj   1   
Error   LNK1120 1 unresolved externals  MyProject3  C:\Users\riema\Documents\Unreal Projects\MyProject3\Plugins\StreetMap\Binaries\Win64\UE4Editor-StreetMapRuntime.dll 1   
Error       UBT ERROR: Failed to produce item: C:\Users\riema\Documents\Unreal Projects\MyProject3\Plugins\StreetMap\Binaries\Win64\UE4Editor-StreetMapRuntime.dll  MyProject3  C:\Users\riema\Documents\Unreal Projects\MyProject3\Intermediate\ProjectFiles\UnrealBuildTool   1   
Error   MSB3075 The command ""C:\Games\Epic Games\UE_4.21\Engine\Build\BatchFiles\Build.bat" MyProject3Editor Win64 Development "C:\Users\riema\Documents\Unreal Projects\MyProject3\MyProject3.uproject" -WaitMutex -FromMsBuild" exited with code 5. Please verify that you have sufficient rights to run this command.   MyProject3  C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.MakeFile.Targets   44  

Many thanks for all this help.

Korky commented 5 years ago

So I spent the weekend looking into this issue there's a couple of warnings in the log that suggest some fixes but right now in mine is not compiling cause of missing modules (link error) let you know what I figure out tonight, but seems couple of people having issues in other versions of unreal, you should look at their solutions maybe is the same missing modules

randoomx8 commented 5 years ago

Hey @Korky, I too am having the same issue C:\Users\[myname]\Documents\Unreal Projects\Worldgen\Plugins\StreetMap\Source\StreetMapImporting\StreetMapImporting.Build.cs : warning : Modules must specify an explicit precompiled header (eg. PrivatePCHHeaderFile = "StreetMapImporting.h") from UE 4.21 onwards. Would have been nice for the master to also include a copy of a project with the plugin already working...

randoomx8 commented 5 years ago

c00t , Youre a genious ! I can confirm that 4.21 compiles with your fix (and #52 + #46) I attempted to do this but will still not work.

Korky commented 5 years ago

it compiles but doesn't work?

randoomx8 commented 5 years ago

@Korky Yes, it rebuilds properly, but when I open it, it claims that 2 files in the plugin did not build, attempting to rebuild them just fails.

Korky commented 5 years ago

@randoomx8 so I got it to build with c00t's fix and builds and runs did you do the fix in #59 ? I did that also and is running

those are probably the 2 files you are having issues with

randoomx8 commented 5 years ago

@Korky I dont have much to say, I added all changes, still wont work.

riemannulus commented 5 years ago

Thanks, I did it!

Eventually, I fix this issue.

Step

  1. Merge this code https://github.com/ue4plugins/StreetMap/pull/52
  2. Merge this code https://github.com/ue4plugins/StreetMap/pull/46
  3. Merge this code https://github.com/ue4plugins/StreetMap/issues/60#issuecomment-461543423
  4. rebuild all
  5. clear

Thanks for all, specially @Korky !

ParaO commented 5 years ago

Thanks, I did it!

Eventually, I fix this issue.

Step

  1. Merge this code #52
  2. Merge this code #46
  3. Merge this code #60 (comment)
  4. rebuild all
  5. clear

Thanks for all, specially @Korky !

Me too got it working with these steps! Windows 8.1 ue 4.21.2 visual studio 2015!!!:) Thanks everyone

liteglow commented 5 years ago

I got nothing.. Using UE 4,21 win10

liteglow commented 5 years ago

I got ERROR : MyProject could not be compiled (Compile Manually) ! What engine v. do I need to install to use this plugin ?

please.

Thank you for any help

vega-holdings commented 5 years ago

image I built it from a fork of the project that seemed to have all the commits for 4.2.2 and it worked. I'm 100% new to UE engine but I was able to figure it out from the comments here.

randoomx8 commented 5 years ago

image I built it from a fork of the project that seemed to have all the commits for 4.2.2 and it worked. I'm 100% new to UE engine but I was able to figure it out from the comments here.

Do you have a link to that fork?

vega-holdings commented 5 years ago

image I built it from a fork of the project that seemed to have all the commits for 4.2.2 and it worked. I'm 100% new to UE engine but I was able to figure it out from the comments here.

Do you have a link to that fork?

https://github.com/keru1264/StreetMap