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"

[Closed] [SOLVED] Static Class/Variables, unresolved external issue.

Moral of this question: Don't code on an empty stomach and after a long day at work. I simply (read: like an idiot) forgot to actually declare the variables in my static CPP file.

I followed a wiki tutorial located here: https://wiki.unrealengine.com/Static_Function_Libraries,_Your_Own_Version_of_UE4_C%2B%2B,_No_Engine_Compile_Times

I have a function called "TestFunction" that is static that I am successfully calling as a static from another class. However, I also have some variables within this static class, but, I'm having trouble assigning or using them, I repeatedly get "unresolved externals" on them. Maybe, I'm just tired, but, here's what I have in the static class:

 #pragma once
 
 #include "Calculator.h"
 #include "Object.h"
 #include "TheStaticWorld.generated.h"
 
 UCLASS()
 class UTheStaticWorld : public UObject
 {
     GENERATED_UCLASS_BODY()
 
     static ACalculator* calculator;
     static TArray<AActor*, FDefaultAllocator> worldactors;
     static TArray<APawn*, FDefaultAllocator> worldpawns;
 
     static void SetCalculator(ACalculator* calc);
     static void TestFunction();
 };
 

ACalculator is literally just an Actor class that I have in my program that was written in C++ as well (I do everything through C++.) ACalculator works just fine in and of itself when used as an object, and I have been using it for weeks, however, again, unresolved external when attempting to implement a static version of it into this static class.

The same goes for the two TArray, both are unresolved externals if I attempt to access, assign, or use them (stack or heap, pointer or not.)

Anyone with any ideas on what would clear this up I'd love to hear from.

Any extra information that you want please feel free to ask. Thanks in advance.

Product Version: Not Selected
Tags:
more ▼

asked Jun 07 '14 at 12:59 AM in C++ Programming

avatar image

dlwlgns
25 10 11 12

avatar image daraevolution Jun 23 '17 at 11:48 AM

How do u resolved that problem?

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

The question has been closed Jun 07 '14 at 04:32 PM by Jamie Dale for the following reason:

User answered their own question :)


0 answers: sort voted first

Follow this question

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

Answers to this question