Pls Help! Got a lot of errors in OnlineSubsystemModule.h

Hi I am A Blueprint Developer and trying to get Face book authentication working with Game Sparks and was following This. and it shows like 17 errors
I created a actor component c++ class inside of ue4 and pasted the code that they gave on the website both on my custom c++ class .cpp and .h and it did not work and when i was trying to PIE it crashed the PIE Window When I closed UE4 and opened it it did not work and it said try rebuilding from source manually what should I do

PLS Help

Output Logs: Output Log - Pastebin.com

I have slight understanding of C++ Code

If you would need

Picture of the errors : Share - Google Drive

My code(Just to see whether There is a problem with my code) : Code - Pastebin.com

I Deleted the FBAPIComponent and still 25 errors and 31 in intellisense

It appears there is a typo in the code (from your code link):

ONLINESUBSYSTEM_API "bool DoesInstanceExist(const FName InSubsystemName) const;
--------------------------^
Usually one or two errors create hundreds of compound errors.

It seems like Intellisense is causing the problem because in the error list when I select Build only it shows 23 errors, Intellisense only there it is showing 4500 errors

And You said I made a typo in my code. where??

Severity Code Description Project File Line Suppression State
Error C2039 ‘IsOnlineSubsystemLoaded’: is not a member of ‘FOnlineSubsystemModule’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystem.h 248
Error C2059 syntax error: ‘string’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 155
Error C2238 unexpected token(s) preceding ‘;’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 162
Error C2039 ‘DoesInstanceExist’: is not a member of ‘FOnlineSubsystemModule’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystem.h 233
Error C2039 ‘IsOnlineSubsystemLoaded’: is not a member of ‘FOnlineSubsystemModule’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystem.h 248
Error C2059 syntax error: ‘string’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 155
Error C2238 unexpected token(s) preceding ‘;’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 162
Error C2039 ‘DoesInstanceExist’: is not a member of ‘FOnlineSubsystemModule’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystem.h 233
Error C2039 ‘IsOnlineSubsystemLoaded’: is not a member of ‘FOnlineSubsystemModule’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystem.h 248
Error C2059 syntax error: ‘string’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 155
Error C2238 unexpected token(s) preceding ‘;’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 162
Error C2039 ‘DoesInstanceExist’: is not a member of ‘FOnlineSubsystemModule’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystem.h 233
Error C2039 ‘IsOnlineSubsystemLoaded’: is not a member of ‘FOnlineSubsystemModule’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystem.h 248
Error C1083 Cannot open include file: ‘OnlineSubsystemFacebook.h’: No such file or directory Traitors D:\Game Development\Unreal Engine 4\UE4 Projects\Traitors\Source\Traitors\FBAPIComponent.h 7
Error C1083 Cannot open include file: ‘OnlineSubsystemFacebook.h’: No such file or directory Traitors D:\Game Development\Unreal Engine 4\UE4 Projects\Traitors\Source\Traitors\FBAPIComponent.h 7
Error C2059 syntax error: ‘string’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 155
Error C2238 unexpected token(s) preceding ‘;’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 162
Error C2039 ‘DoesInstanceExist’: is not a member of ‘FOnlineSubsystemModule’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystem.h 233
Error C2039 ‘IsOnlineSubsystemLoaded’: is not a member of ‘FOnlineSubsystemModule’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystem.h 248
Error C2059 syntax error: ‘string’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 155
Error C2238 unexpected token(s) preceding ‘;’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 162
Error C2039 ‘DoesInstanceExist’: is not a member of ‘FOnlineSubsystemModule’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystem.h 233
Error MSB3073 The command D:\Epic Games\UE_4.25\Engine\Build\BatchFiles\Rebuild.bat TraitorsEditor Win64 Development -Project=D:\Game Development\Unreal Engine 4\UE4 Projects\Traitors\Traitors.uproject -WaitMutex -FromMsBuild exited with code -1. Traitors C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 55

All my current errors

ONLINESUBSYSTEM_API "bool DoesInstanceExist(const FName InSubsystemName) const;
--------------------------^

There is a quotation after the ONLINESUBSYSTEM_API, in front of the bool. If this happens, it will think everything after it is a string literal. Do you have an “unterminated string constant” error somewhere?

Also, that uppercase macro thing (ONLINESUBSYSTEM_API) that comes before your functions has to have a definition somewhere:


If there’s no definition, that will also cause an error. Check if ONLINESUBSYSTEM_API is defined, and if it isn’t, try replacing all occurrences of it with the one that comes with your project. This should be TRAITORS_API (assuming that’s the name of your project from the build error).

1 Like

No this does not come with my project it comes with unreal engine [D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h] and I did not get the error “unterminated string constant”

Thanks for helping Me

Yes the MACRO ONLINESUBSYSTEM_API is defined it is also purple in my code

I did not get the error “unterminated string constant”, but i got (syntax error ‘string’ on the same line)

Removed both the quotations in the front and the back
Now rebuilding

will update when completed

I might not be surprised if the error came from my code but it is coming from unreal engine’s official code

Can you like create a new project and add the FBAPIcomponent as said in the website Here ( the tutorial I followed) and rebuild it and check if you are experiencing any errors

One more thing… did you make sure to include the OnlineSubsystem in your build.cs file? (Pictured above.)
If not, try uncommenting that line with “OnlineSubsystem”.

2 Likes

Thanks it reduced to 3 errors

Severity Code Description Project File Line Suppression State
Error MSB3073 The command D:\Epic Games\UE_4.25\Engine\Build\BatchFiles\Rebuild.bat TraitorsEditor Win64 Development -Project=D:\Game Development\Unreal Engine 4\UE4 Projects\Traitors\Traitors.uproject -WaitMutex -FromMsBuild exited with code -1. Traitors C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 55
Error C1083 Cannot open include file: ‘OnlineSubsystemFacebook.h’: No such file or directory Traitors D:\Game Development\Unreal Engine 4\UE4 Projects\Traitors\Source\Traitors\FBAPIComponent.h 7
Error C1083 Cannot open include file: ‘OnlineSubsystemFacebook.h’: No such file or directory Traitors D:\Game Development\Unreal Engine 4\UE4 Projects\Traitors\Source\Traitors\FBAPIComponent.h 7

Now 3 build errors and 10 intellisense errors

Thanks

Severity Code Description Project File Line Suppression State
Error C3646 ‘EnumerateOnlineSubsystems’: unknown override specifier Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error Unable to delete D:\Game Development\Unreal Engine 4\UE4 Projects\Traitors\Intermediate\Build\Win64\TraitorsEditor\Development (Unable to delete \?\D:\Game Development\Unreal Engine 4\UE4 Projects\Traitors\Intermediate\Build\Win64\TraitorsEditor\Development\Engine\SharedPCH.Engine.ShadowErrors.h) Traitors D:\Game Development\Unreal Engine 4\UE4 Projects\Traitors\Intermediate\ProjectFiles\UnrealBuildTool 1
Error C2144 syntax error: ‘bool’ should be preceded by ‘;’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 155
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 155
Error C3646 ‘EnumerateOnlineSubsystems’: unknown override specifier Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error C2065 ‘EnumCb’: undeclared identifier Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error C2275 ‘FOnlineSubsystemModule::FEnumerateOnlineSubsystemCb’: illegal use of this type as an expression Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error C2096 ‘ONLINESUBSYSTEM_API’: A data member cannot be initialized with a parenthesized initializer Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error C2182 ‘ONLINESUBSYSTEM_API’: illegal use of type ‘void’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error C1903 unable to recover from previous error(s); stopping compilation Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error C2144 syntax error: ‘bool’ should be preceded by ‘;’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 155
Error C4430 missing type specifier - int assumed. Note: C++ does not support default-int Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 155
Error C2065 ‘EnumCb’: undeclared identifier Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error C2275 ‘FOnlineSubsystemModule::FEnumerateOnlineSubsystemCb’: illegal use of this type as an expression Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error C2096 ‘ONLINESUBSYSTEM_API’: A data member cannot be initialized with a parenthesized initializer Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error C2182 ‘ONLINESUBSYSTEM_API’: illegal use of type ‘void’ Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error C1903 unable to recover from previous error(s); stopping compilation Traitors D:\Epic Games\UE_4.25\Engine\Plugins\Online\OnlineSubsystem\Source\Public\OnlineSubsystemModule.h 181
Error MSB3073 The command D:\Epic Games\UE_4.25\Engine\Build\BatchFiles\Rebuild.bat TraitorsEditor Win64 Development -Project=D:\Game Development\Unreal Engine 4\UE4 Projects\Traitors\Traitors.uproject -WaitMutex -FromMsBuild exited with code -1. Traitors C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targets 55