0

I wrote a small debugging code that allows you to display the Processor, Video card, as well as the user's OS When writing code using a function

static FString GetOSVersion()

I get the numeric version of the OS When using another function (which is used in the code), it should show more information. The function itself

static void GetOSVersions
(
    FString & out_OSVersionLabel,
    FString & out_OSSubVersionLabel
)

I implemented it into the code, but for some reason I have an error, please help me. (I'm just learning c++, so maybe a very stupid question)

Code Screen: enter image description here

I tried to fix the code, Googled, asked the AI, but the same Chat GTP says that the code is executed correctly, they say The problem in your code is calling the static function FWindowsPlatformMisc::GetCPUBrand(), FWindowsPlatformMisc::GetCPUVendor(), FWindowsPlatformMisc::GetPrimaryGPUBrand(), FWindowsPlatformMisc::GetOSVersion() and FWindowsPlatformMisc::NumberOfCores(). Your project is probably configured to use a different operating system or platform than Windows.

To fix the "too many arguments in function call" error, you should use the appropriate functions for your target platform. For example, if you are using a different platform, then you need to use other methods to get information about the processor, graphics card, operating system version and the number of processor cores.

Let's assume that you are working with the Windows platform and have correctly connected all the necessary libraries. Then your code might look something like this:

3
  • 2
    Welcome to Stackoverflow. Please do NOT upload code as images, use text instead. Long code snippets are shortened (and can be expanded by click). Commented May 5, 2024 at 15:05
  • 3
    GetOSVersion != GetOSVersions Commented May 5, 2024 at 15:08
  • Please create a minimal reproducible example that you copy-paste as text into your question. Commented May 5, 2024 at 15:09

1 Answer 1

2

well, if you are calling GetOSVersion (note the absence of the trailing s) the propotype specifies that it takes no arguments, and you are passing two, therefore the too many arguments error.

Sign up to request clarification or add additional context in comments.

1 Comment

And really, thank you very much There are just two types in the documentation GetOsVersion and GetOsVersion When I was writing the code, I apparently forgot that I also need to add s to the word here Thanks again

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.