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"

MakeLiteralInt Question and Error

What exactly are literal ints and how are they used? An example would really help.

I also get an error whenever I try to call the MakeLiteralInt function.

This is the include in my source file for the function:

 #include "Kismet/KismetSystemLibrary.h"

This is my code in the source file:

 int j = UKismetSystemLibrary::MakeLiteralInt(0);

This is my error message:

Error 20 error LNK2019: unresolved external symbol "public: static int __cdecl UKismetSystemLibrary::MakeLiteralInt(int)" (?MakeLiteralInt@UKismetSystemLibrary@@SAHH@Z) referenced in function "public: __cdecl AIntroToProgCharacter::AIntroToProgCharacter(class FObjectInitializer const &)" (??0AIntroToProgCharacter@@QEAA@AEBVFObjectInitializer@@@Z) C:\Users\Ben\Documents\Unreal Projects\IntroToProg\Intermediate\ProjectFiles\IntroToProgCharacter.cpp.obj IntroToProg

Product Version: Not Selected
more ▼

asked Jan 04 '15 at 12:03 AM in C++ Programming

avatar image

483 53 37 57

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

MakeLiteralInt (along with the other MakeLiteral functions) is simply a helper function for use in blueprints. The value passed into the function can be set in the blueprint node, and is then available on the output pin.

Of course, you could instead just enter that same value in to whatever input pin that output pin's connected to. The advantage here is that it allows you to connect the output to multiple input pins, ensuring that when you change the single int value, it changes for all of the connected pins.

There's no reason to use UKismetSystemLibrary::MakeLiteralInt outside blueprints. It's giving you a linker error because UKismetSystemLibrary is not declared as a public API class.

more ▼

answered Jan 09 '15 at 05:28 PM

avatar image

465 20 20 40

avatar image BitBoy92 Jan 09 '15 at 07:59 PM

Thank you for the explanation Sneftel. It does help expalin what MakeLiteralInt does and how it is used.

(comments are locked)
10|2000 characters needed characters left

So I resolved my error by just simply using the source code from the method directly. I am still a little confused as to what literal ints and if they are different from regular ints.

more ▼

answered Jan 09 '15 at 05:13 PM

avatar image

483 53 37 57

(comments are locked)
10|2000 characters needed characters left
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