error: call of overloaded 'cos(double&)' is ambiguous

45 views
Skip to first unread message

Haifei Chen

unread,
Sep 17, 2024, 1:25:56 AM9/17/24
to ProjectChrono
Hello,

While compiling a third-party code coupled with chrono, c++ compiler complained about the said error in ChVector3.h (also for cos and sin)

/users/hfchen/chrono/chrono/src/chrono/core/ChVector3.h:462:18: error: call of overloaded 'cos(double&)' is ambiguous
  462 |     res.x() = cos(norm_angle);  // 1) rot 'norm.angle'about z
  463 |     res.y() = sin(norm_angle);
  466 |     res.y() = projlen * cos(pol_angle);
  467 |     res.z() = projlen * sin(pol_angle);
  848 |     return sqrt(Length2());

I think the issue is similar to this one at https://gitlab.kitware.com/vtk/vtk/-/issues/17144. Could this be resolved similarly as well?

Thanks,
Haifei

Radu Serban

unread,
Sep 18, 2024, 1:40:00 AM9/18/24
to ProjectChrono

Haifei,

Please pull the latest code in the ‘main’ branch and try again. 

Out of curiosity: what 3rd party package are you working with and how do you couple it to Chrono?

--Radu

--
You received this message because you are subscribed to the Google Groups "ProjectChrono" group.
To unsubscribe from this group and stop receiving emails from it, send an email to projectchron...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/projectchrono/de360c23-90d7-4445-aff3-dc2818288f66n%40googlegroups.com.

Message has been deleted

Haifei Chen

unread,
Sep 19, 2024, 9:23:17 PM9/19/24
to ProjectChrono
Hi Radu,

The errors were gone after the update. I'm developing a FSI model using openfoam as the fluid solver. The coupling is simply via calling chrono APIs.

I also wanted to let you know that there were lots of warnings on chrono code when using openfoam's compiler settings. In order to suppress those warnings, I had to add the following options when compiling my code.
    -Wno-sign-compare \
    -Wno-old-style-cast \
    -Wno-non-virtual-dtor \
    -Wno-delete-non-virtual-dtor \


Haifei
Reply all
Reply to author
Forward
0 new messages