Issue with Header file in Visual Studio (C++), very stuck [closed]

I’m a beginner creating a clock project with C++ in Visual Studio. I created a header file, a cpp file for function definitions, and a main file. I declared the function names in the header file and used the format suggested by VS for the definitions in the cpp file.

However, after adding definitions there’s a green squiggly line under the String function declarations in the header file saying “Function definition for ‘stringFunctionName’ not found” when I hover over it. This is only for the string functions.

enter image description here enter image description here enter image description hereenter image description here
How can this be fixed? I’m not able to pass any arguments into the functions within the main file. Please help!!

Tried looking everywhere for a fix but couldn’t find.

  • 3

    Don’t post images of text. Copy-paste text as text.

    – 

  • Also please edit your question to show us a minimal reproducible example.

    – 

  • 1

    On line 14 of Clock.h you declared a function std::string nCharString(); which takes no arguments but you tried to call it with cout << nCharString(5); which passes 1 argument 5 to a function that takes no arguments. You can’t pass the 5 to a function that has no arguments. Maybe your declaration in Clock.h was wrong and you meant it to be std::string nCharString( char someValue);

    – 




Leave a Comment