TOSUN-Shanghai / TSMaster

A powerful open environment for automotive bus monitoring, simulation, testing, diagnostics, calibration and so on. It supports all kinds of mainstream hardware such as TOSUN, Vector, IXXAT, PEAK, Kvaser, Intrepidcs, ZLG, CANable, CandleLight, cantact and so on. Free for research and education purpose for some features.
http://www.tosunai.cn/
GNU Lesser General Public License v2.1
262 stars 41 forks source link

#include<math.h>not working #108

Closed disguiser77 closed 1 year ago

disguiser77 commented 1 year ago

微信图片_20230713113524 I want to use the functions fmaxf and fabsf from math.h, but the compiler gives an error: "error: use of undeclared identifier 'fmaxf'". Why is this happening and how can I resolve it?

freshhope commented 1 year ago

this is because TSMaster's default compiler is C++ builder, you must use the following include:

include <algorithm>

and then use the following code:

    std::max(1.1,2.2);

this will solve your problem.

disguiser77 commented 1 year ago

this is because TSMaster's default compiler is C++ builder, you must use the following include: #include <algorithm>

and then use the following code:

    std::max(1.1,2.2);

this will solve your problem.

Thanks, i solved it.