x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

LNK2001 in class generated by the editor

I got a lot of errors with a class generated by the editor :

error LNK2019: unresolved external symbol "public: virtual void __cdecl ALandscapeProxy::ChangeLODDistanceFactor(float)" (?ChangeLODDistanceFactor@ALandscapeProxy@@UEAAXM@Z) in "public: virtual void __cdecl AAutoLandscape::ChangeLODDistanceFactor(float)" (?ChangeLODDistanceFactor@AAutoLandscape@@UEAAXM@Z)

the code :

AAutoLandscape.H :

 #pragma once
 
 #include "Landscape/Landscape.h"
 #include "AutoLandscape.generated.h"
 
 /**
  * 
  */
 UCLASS(hidecategories = LandscapeProxy, showcategories = (Display, Movement, Collision, Lighting, LOD, Input))
 class NIGHTWINGS_API AAutoLandscape : public ALandscape
 {
     GENERATED_UCLASS_BODY()
 };

AAutoLandscape.CPP

 #include "NightWings.h"
 #include "AutoLandscape.h"
 
 
 AAutoLandscape::AAutoLandscape(const class FPostConstructInitializeProperties& PCIP)
     : Super(PCIP)
 {
 
 }


Product Version: Not Selected
Tags:
more ▼

asked Jul 22 '14 at 09:14 PM in C++ Programming

avatar image

w77
31 8 14 18

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

3 answers: sort voted first

I get the solution on IRC: class ALandscape should be class UNREAL_API ALandscape and UE must be recompiled. There is errors when subclassing a class without UNREAL_API .

more ▼

answered Jul 23 '14 at 04:29 PM

avatar image

w77
31 8 14 18

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Looks like linker cannot find definition of:

 public: virtual void ALandscapeProxy::ChangeLODDistanceFactor(float)

Do you have Engine module dependency defined in yourmodule.Build.cs file ? Example:

 PrivateDependencyModuleNames.AddRange(new string[] { "Engine" });


Marcin

more ▼

answered Jul 23 '14 at 10:36 AM

avatar image

mpo
578 23 15 47

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Report: succeeded in compiling landscape and landscapeEditor modules as two game play modules (not engine modules).
alt text
Overall steps : (4.22)
1.Create an empty project named myproject.
2.Copy over engine/source/runtime/landscape to myproject/source/MimicLand
3.Open in the VS, replace all occurences of "Landscape" to "MimicLand" case-sensitively. Replace LANDSCAPE_API and ENGINE_API properly.
fix build.cs and includes, and revert unwanted replacements of "Landscape" including occurences in "/Engine/EditorLandscapeResources...." from LandscapeEditor module and in structures or varibles that communicat with landscape shaders including "LandscapeProceduralPS.usf" and "LandscapeVertexFactory.ush"
4.Manage to compile the module. to compile LandscapeCollision.cpp as MimicLandCollision.cpp, a series of thirdparty includes should be added in the build.cs :

  PublicIncludePaths.AddRange(
             new string[] {
                 "D:\\unreal\\UE_4.22\\Engine\\Source\\Runtime\\Engine\\Public", 
                 "other includings......"
             });

5.Do the same for the LandscapeEditor module. fix dependcies in the build.cs.
6. success ! ^.^ Have to say unreal engine is wonderful and in a sense very playable itself ...

Main drawbacks:
1. Editor tool icons are lost .
2. FLandscapeStaticLightingTextureMapping::ExportMapping and another method in the LandscapeLight.h defined in the StaticLightingExport.cpp of UnrealEd module, so in the end I think you still need to compile the entire engine ......

screenshot-14.png (28.6 kB)
more ▼

answered Jun 17 '19 at 05:02 PM

avatar image

knziha
1 1 3

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question