Cannot create a C++ project

When I tried to create a C++ project after changing the source code from VS to VS Code (I am using Visual Studio 2019 Community Version), the error popped up saying I cannot compile the file:

Running C:/Program Files/UE_4.22/Engine/Binaries/DotNET/UnrealBuildTool.exe Development Win64 -Project="C:/Users/zimu/Documents/Unreal Projects/我的项目3/我的项目3.uproject" -TargetType=Editor -Progress -NoHotReloadFromIDE
Creating makefile for ?ҵĿ3Editor (no existing makefile)
@progress push 5%
Parsing headers for ?ҵĿ3Editor
  Running UnrealHeaderTool "C:\Users\zimu\Documents\Unreal Projects\?ҵĿ3\?ҵĿ3.uproject" "C:\Users\zimu\Documents\Unreal Projects\?ҵĿ3\Intermediate\Build\Win64\?ҵĿ3Editor\Development\?ҵĿ3Editor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
C:/Users/zimu/Documents/Unreal Projects/????3/Source/????3/????3GameModeBase.h(1): Error: Missing UCLASS name

What should I do?

I see some none English characters… Perhabs it could be affecting it. Not sure though

can you show GameModeBase.h code?

Sorry, I am quite new and don’t know where I can find that code. Is it a file that defines how the game is played?

Yeah, there are some Chinese characters inside because I am using a Chinese version of Epic Game Launcher and UE4. There are some "?"s in the error message too.

asked you for GameModeBase.h file because according to the log file UCLASS name is missing in this file.

 C:/Users/zimu/Documents/Unreal Projects/????3/Source/????3/????3GameModeBase.h(1): Error: Missing UCLASS name

Path to the file is displayed so you can just open it and paste it’s content here so we can check it.

// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include “CoreMinimal.h”
#include “GameFramework/GameModeBase.h”
#include “我的项目3GameModeBase.generated.h”
class 我的项目3_API A我的项目3GameModeBase : public AGameModeBase


here it is, “我的项目3” means “My project 3” in Chinese

It works! I honestly don’t know it is this simple. Thanks a lot for the help here.

I am afraid it’s connected with non-English characters as Saltylele backup suggested. You should not use any non-English characters in source code when writing C++. However you said in your first post that your project stopped compiling after changing VS to VS Code? Is that correct? Can you confirm it was compiling before just fine?

I tried create new C++ class in my test project with non-English characters in it’s name (just in case) and it didn’t work too.

No problem. Good luck and have fun with Unreal Engine. :slight_smile: