Hi, I'm using Microsoft Visual C++ and I keep getting this error referring to this one line in my main file . can someone HELP ME ?

#include <iostream>

using namespace std;
int main()
{
	float tempFahrenheit;
	float tempCelsius;
	float Omrekenen;

	cout << "Geef de temperatuur in Fahrenheit: ";
	cin >> tempFahrenheit;
	tempCelsius =Omrekenen(tempFahrenheit);
	cout << "\n Dit is de temperatuur in Celsius: ";
	cout << tempCelsius << endl;
	return 0;
}
float Omrekenen(float tempFahrenheit)
{
	float tempCelsius;
	tempCelsius = (tempFahrenheit - 32)*5/9;
	return tempCelsius;
}

Dani AI

Generated

The MSVC error C2064 ("term does not evaluate to a function taking 1 arguments") means the compiler saw an identifier at a call site that it could not treat as a callable with the indicated parameter list. In this thread the call was resolved to a non-callable symbol (a local float) that hid the intended function. As noted, a forward declaration (prototype) moves the function's type into scope before use; as demonstrated, giving the function and the variable different names also resolves the conflict. confirmed the issue was fixed (Omrekenen = "convert").

A compact illustration of the common mistake and two safe fixes:

Problem (name collision hides function)

int incr(int x) { return x + 1; }

int main() {
    int incr = 5;      // hides the function name
    int r = incr(2);   // error: 'incr' is not callable
}

Fix A — don't reuse the same name (rename the variable)

int incr(int x) { return x + 1; }

int main() {
    int value = 5;
    int r = incr(2);   // OK
}

Fix B — if the intent is to hold a callable, use a function pointer or std::function

int incr(int x) { return x + 1; }

int main() {
    int (*fn)(int) = incr;
    int r = fn(2);     // OK
}

Quick troubleshooting checklist

  • Look for a local/global variable with the same identifier as the function; rename or remove it.
  • Ensure a function prototype or the function definition appears before its use.
  • Verify the call's argument count and types match the function's signature. A mismatched signature can produce the same or a related error.
  • If storing a callable in a variable, declare the correct function-pointer or std::function type (or use a lambda).

These steps explain why the original call failed and offer alternatives that avoid shadowing or declaration-order problems.

Recommended Answers

All 5 Replies

Just like variables, functions have to be declared before you use them:

#include <iostream>

using namespace std;

float Omrekenen(float tempFahrenheit);

int main()
{
	float tempFahrenheit;
	float tempCelsius;
	float Omrekenen;

	cout << "Geef de temperatuur in Fahrenheit: ";
	cin >> tempFahrenheit;
	tempCelsius =Omrekenen(tempFahrenheit);
	cout << "\n Dit is de temperatuur in Celsius: ";
	cout << tempCelsius << endl;
	return 0;
}
float Omrekenen(float tempFahrenheit)
{
	float tempCelsius;
	tempCelsius = (tempFahrenheit - 32)*5/9;
	return tempCelsius;
}

im still having problems, with the code after declaring the function, same error massege

im still having problems, with the code after declaring the function, same error massege

I don't know in what language you are writing, but the reason the compiler complained is that you used the word Omrekenen{what does it mean by the way?} as a function name and as a float...

i changed your code to::

#include <iostream>

using namespace std;

float Omrekenen_func(float tempFahrenheit);

int main()
{
	float tempFahrenheit;
	float tempCelsius;
	float Omrekenen;

	cout << "Geef de temperatuur in Fahrenheit: ";
	cin >> tempFahrenheit;
	tempCelsius =Omrekenen_func(tempFahrenheit);
	cout << "\n Dit is de temperatuur in Celsius: ";
	cout << tempCelsius << endl;
	return 0;
}

float Omrekenen_func(float tempFahrenheit)
{
	float tempCelsius;
	tempCelsius = (tempFahrenheit - 32)*5/9;
	return tempCelsius;
}

and everything compiled fine!

PS:: if this solves your problem, plz mark it the thread as solved!

omreken means to convert, im writing in dutch language .
and de code is working now thank you .

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.