UBlueprintFunctionLibrary problem

Hello everyone!

I have problem with setting new file in my project.

I added a folder, I added a file Types.cpp/.h in UE content browser

  • I cleared folder with project
  • Generated Visual Studio Porject files
  • Rebuilded project from VS

BUT

Engine cant see this file and folder in Source folder, and VS can’t normal recognize it for further work.

What i missed?

VS2

I’m guessing you named your library wrong. You cannot create a library from the add c++ file in the editor with the name Types

Rename your library to something else and try regenerating your vs project.

@3dRaven Thanks for your answer, but it not works. And one thing I forgot - my version UE 4.26

You did it in UE5, I think here some differents

I think you didn’t understand what i wrote. You are making a library that has the same name as an engine class. You cannot do that no matter of the engine version.
Pick a new name for the library from UTypes to something unique.

NewName is the new name of the library

You will need to change
Types.h to NewName.h
Types.cpp to NewName.cpp
Types.generated.h to NewName.generated.h
TDS_Skillbox_API UTypes : public UBlueprintFunctionLibrary to TDS_Skillbox_API UNewName : public UBlueprintFunctionLibrary

Then regenerate your project so that the .generated file is rebuilt

@3dRaven ok, i’ll try

@3dRaven not working. I think, I should recreate project, but I don’t want :cry:

Any another ideas? Or my naming still bad?

Where is your
#include "CoreMinimal.h"
inside of your types.h ?
Put it in on top of includes.

1 Like

GameTypesClass.h

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "GameTypesClass.generated.h"

/**
 * 
 */
UCLASS()
class TDS_SKILLBOX_API UGameTypesClass : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()
	
};

GameTypesClass.cpp

// Fill out your copyright notice in the Description page of Project Settings.

#include "GameTypesClass.h"

Just swap the api my project made all uppercase for some reason

Also I would suggest upgrading to visual studio 2022 it fixes the : underline

1 Like

I found!

@3dRaven I copied your code to myself, and the problem disappeared. After checking your and my versions, I found that all the letters in this place (image) are written in uppercase! It was just that.

Thank you!

Wrong

Right

@CtnDev thank you too, I forgot about core minimal