When I use a float to cast a value I get this link error that I do not know how to solve.
"Link Error : L1822 Symbol _FUFLOAT in file ...... is undefined"
This is an example of the code that causes the error.
uint16_t adc1, egt1;
egt1 = (int16_t)((float)adc1 / 204.8);
Ray.
已解决! 转到解答。
Hi Ray.
your project using float operation but doesn't have floating library support.
when creating a new project, choose floating lib as i highlight below. this can solve the problem.
can this help?
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Ray.
your project using float operation but doesn't have floating library support.
when creating a new project, choose floating lib as i highlight below. this can solve the problem.
can this help?
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Ray,
We can remove the integral lib and add floating support lib into project.
In your CW project management window, “lib” folder, you could see one file called “ansibi.lib” (bank model for instance), please remove this lib from your project and import a new lib “ansib.lib” or “ansibf.lib” to substitute it.
The method to import is: right click project management window, click “Add files…”, then in the opened select files window, go to {CW install folder}\lib\hc12c\lib to import right lib file.
Let take small model lib as example:
- ansibi.lib --- Integral only bank
- ansib.lib --- IEEE32/32 bank
- ansibf.lib --- IEEE32/64 bank (compiler option: -Cf)
if you select IEEE32/64 support, you need add –Cf to compiler setting to let compiler know double is 64bit.
. if you have -D__NO_FLOAT__ in your compiler setting, please remove it.
You can go to the CW menu “help”, in “search”tab, input “ansibf.lib” and search, you could all the information of the lib file. I also attach the txt tells about that.
if this post is helpful to you, please click "Helpful" as "Yes". thanks!
Have a great day,
Zhang Jun
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------