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"

'xxx' uses undefined class 'WORLDBROWSER_API' error

Hi,

Since Unreal Engine 4.20, I'm getting a 'FLevelModel' uses undefined class 'WORLDBROSWER_API' error in UE Engine's LevelModel.h while trying to compile an HostProject (to compile a plugin).

As I saw in another thread (https://answers.unrealengine.com/questions/769047/loading-umaps-into-leveleditor.html), I've added:

 PublicIncludePaths.AddRange(new string[]
  {
      Path.Combine(EngineDirectory, "Source/Editor/WorldBrowser/Public"),
      Path.Combine(EngineDirectory, "Source/Editor/WorldBrowser/Private")
  });

to either the hostproject's and plugin's Build.cs but the error is still there.

The error is in LevelModel.h on line 30:

 class WORLDBROWSER_API FLevelModel
     : public TSharedFromThis<FLevelModel>
 {...}

(I get the same error with FLevelCollectionModel.h as well)

How could I fix this?

Product Version: UE 4.20
Tags:
more ▼

asked Sep 16 '18 at 09:10 AM in C++ Programming

avatar image

Ticki84
1 1 2 3

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

1 answer: sort voted first

That header file are in private directory it is not intended to be accessed outside the module that it is, it actully makes me wonder why you didn't get linker errors from this

This macro pastes extern in case that module is compiled in to sperate dll. First of all you should make usre you add dependence for WorldBrowser module, UBT at that case should automatically solve all pathing and macro issues. If thats not work there other hack you can use, do #define WORLDBROWSER_API before include and #undef WORLDBROWSER_API after it, but again it is a hack to satisfy the compiler ;p so there might be even more serious issues, but if it worked for you in 4.19 then it will work the same as in that version.

The main issue is you trying to access header file from private, if you making plugin for market place you might have issues getting passed the submission checks.

more ▼

answered Sep 16 '18 at 08:58 PM

avatar image

Shadowriver
37.3k 936 172 1116

avatar image Seim2k Apr 02 '19 at 03:23 PM

As I come to a similiar problem but with another background, I have a question regarding these "_API - Definitions" . Why do I need this, or why do Unreal need this?

(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