C++ Error: Underscores in Function Names

  • Context: C/C++ 
  • Thread starter Thread starter ehrenfest
  • Start date Start date
  • Tags Tags
    C++ Function
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 3K views
ehrenfest
Messages
2,001
Reaction score
1
I got the following error when I tried to compile some code:

Code:
error: `angle_between' cannot be used as a function

I changed the function name to "function1" and it compiled. Since when did C++ not like underscores in function names?
 
Physics news on Phys.org
The underscore isn't a problem ( although leading and trailing ones can cause issues)
Are you sure you haven't got a angle_between() typo somewhere ?

Can you post the line the compiler complains about?
 
Yeah, it "looks" fine. Maybe you should post the code and where the compiler cries.
 
Grep your sources looking for angle_between, could be it was defined earlier as something else.