Bug in cmath pow? (typecasting, symbol unresolved)

Hi all,

from the ROOT command line:

#include <cmath>

std::pow(2, 3) -> OK
std::pow(2.5, 3.5) -> OK
std::pow(2.5, 3) -> symbol unresolved

IncrementalExecutor::executeFunction: symbol '?pow@@YANNH@Z' unresolved while linking [cling interface function]!
You are probably missing the definition of double __cdecl pow(double,int)
Maybe you need to load the corresponding shared library?

It looks like that if arguments are both integers, or both doubles/floats, it works fine, but when one argument is int and the other is double, it cannot resolve the function.

I don’t think this is neither an intended nor a compliant behavior… maybe a bug?

According to this doc, it should work even with mixed bases:
http://www.cplusplus.com/reference/cmath/pow/

Duccio

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Hi Wile, you’re right. Sorry for the lack of those details.

ROOT 6.18/04
Built for win32 on Sep 11 2019, 15:38:23 |
From tags/v6-18-04@v6-18-04

on Windows 10, precompiled binaries from the site, Production Release Release 6.18/04 - 2019-09-11 (Release 61804 - ROOT)

UPDATE:

On a “cold start” I am unable to reproduce the error, pow works fine. It is only after some time of working (and loading of macros) that the error started appearing, both with the macros and on command line.

It could be that it’s related to the typecasting or linking or other parts of the system that got corrupted, rather than to the pow function.

The macros I was running were not particularly memory or resource intense (a few thousands calculations), so that shouldn’t be the problem.

The closest related post I found was this one

@bellenot might be able to reproduce this if you can give us a reproducer… Without we cannot do much. I believe it’s not a known issue.

Cheers, Axel.

I managed to get it again (but I have no idea what I did to obtain it).

root [4] .L Particle.cpp
IncrementalExecutor::executeFunction: symbol '?log@@YAMM@Z' unresolved while linking function '??__Eid@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A@YAXXZcling_module_12_'!
You are probably missing the definition of float __cdecl log(float)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '??0ResonanceType@@QAE@PADNHN@Z' unresolved while linking function '??__Eid@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A@YAXXZcling_module_12_'!
You are probably missing the definition of public: __thiscall ResonanceType::ResonanceType(char *,double,int,double)
Maybe you need to load the corresponding shared library?
IncrementalExecutor::executeFunction: symbol '?pow@@YANNH@Z' unresolved while linking function '??__Eid@?$num_put@DV?$ostreambuf_iterator@DU?$char_traits@D@std@@@std@@@std@@2V0locale@2@A@YAXXZcling_module_12_'!
You are probably missing the definition of double __cdecl pow(double,int)
Maybe you need to load the corresponding shared library?

This time I’m running ROOT inside the “Visual Studio 2019 Developer Command Prompt v16.3.6” but I don’t think that matters, because the last time I started ROOT from its Windows icon.

I’m sending you the complete list of what I did from the opening of the command prompt, and the two files I was loading (Particle and ParticleType

Is anything else I can do?

bugreproducer.txt (21.4 KB)

Particle.cpp (6.2 KB)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.