Unresolved External Symbol | Struct & Linker Error

I thought that too, but I can’t find one and Visual Studios Intelisense isn’t giving me any syntax errors, which it always has done before if that were the case. Thanks though.

It says it is FStatusEffect::FStatusEffect(), which looks like the constructor of FStatusEffect. If you can’t figure it out, show me a screenshot of this class, both the .h and .cpp

I think you have to define the constructor of a struct in the header file.
Just type: FStatusEffect() { //functionality in here }

Also, try to remove the default values for the arguments and see if that works

Unfortunately, it didn’t work. Thanks again though.

And also remove the constructors from the cpp

I did but I didn’t work either.

Did you do that for all the functions and structs that were giving you the error? If so, do you still get the same errors?

Yes, that’s correct.

I did forward declare my structures in a separate file and then included them in the files I used them. I also don’t get any red squiggly line in visual studios. Thanks though.

Alright, can you upload your project somewhere so I can look into it?

I ran into some complications when trying to upload it to GitHub so I opted to upload it to Google Drive; I hope this isn’t a problem and that the files were uploaded correctly. Anyways, here is the sharable link: https://drive.google.com/drive/folders/1nMjX8DYFo-3eP34SBz4lp_blWt5umABF?usp=sharing

You forgot to define the constructor for FStatusEffect in the source file. You declare it but never define it.

If you fix that up, everything else seems fine from what I can see at a glance.

I’m confused, didn’t I? Were you perhaps talking about a different structure of mine?

Weird. The source file was missing on your project you posted. I’ll take another look if that’s not the case in your master project.

268552-files.png

No problem, i’m gonna take a look tomorrow.

Apologies, I couldn’t find an alternative to google drive for uploading the project files (I tried github but ran into complications). It’s likely that StatusEffect.cpp wasn’t uploaded since a lot of other files were rejected (mainly .obj files).

I fixed 2 of the 3 remaining errors and I’m fairly sure I can fix the final errors. One error was because the constructor for one of my structures was in a source file (.cpp) that was created in the intermediate folder rather than the source folder. This is because by default Visual Studios creates files there for Unreal Project, I knew this and thought I had a handle on it but at some point, I slipped up and accidentally created a file without changing the file creation location. The other error was because I declared a constructor in a struct that didn’t need one, so I never defined it and that caused an error which I fixed by removing the declaration. The last error was caused by me creating a variable of type UUserWidget (it was also a pointer), I think this might be caused by the need of a line of code in the build.cs file for you to be able to utilize UUserWidger, but I am not sure in the slightest. Unfortunately, after removing the line of code declaring the UUserWidget variable and as well as removing he include for it, the engine crashed during a hot reload. Now I can’t get it to open, and this is what I’m currently trying to debug.

I encountered similar issue, and realized it was because I did not add the _API specifier macro for proper exposing my struct (it was in another module than the module I was using it).

1 Like