This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compile Error with IQmath, function "_IQdiv2" declared implicitly, but other IQmath functions like _IQmpy work fineI'm

I'm modifying a very well debugged production project in CCS v6.1.0. I'm using DSP/Bios 5.42.1.09 and C compiler 6.4.6. I had good success today when using just the _IQmpy(A, B) function with no compile errors or warnings. But when I added either _QNtoIQ( int A) or _IQmpy2(_Iq A) functions, I get the function declared implicitly error and the following additional compile errors:

--Description Resource Path Location Type unresolved symbol __IQdiv2, first referenced in ./SingenX400a_3Ph.obj SingenX400a_3Ph C/C++ Problem

--Description Resource Path Location Type #171 expected a declaration SingenX400a_3Ph_variable_defs.h /SingenX400a_3Ph line 57 C/C++ Problem

--Description Resource Path Location Type<a href="file:/c:/ti/ccsv6/tools/compiler/dmed/HTML/10234.html">#10234-D</a> unresolved symbols remain SingenX400a_3Ph C/C++ Problem

--Description Resource Path Location Type unresolved symbol __IQdiv2, first referenced in ./SingenX400a_3Ph.obj SingenX400a_3Ph C/C++ Problem

That's it in a nutshell. When I remove the offending iq math functions, it's ok, but I need those so I can replace floating point math that's bogging down my code SWIs, with much faster IQmath. Of course, I have the proper IQmathlib.h reference in my main C file, and I set the math type to IQ and the Global IQ value to iq15. Anyway, I don't hjave problems until I start using those additional iq math functions. 

Any suggestions? Thanks in advance.

  • The errors dont seem to have anything to do with the QNtoIQ and IQmpy2. It looks like the file "SingenX400a_3Ph.c" uses the function IQdiv2 (which the error is about); its likely the IQmathLib.h is not included in this file.
  • _IQmpy() is directly supported by the compiler code generation, and is not a function call. The other IQ functions you cite, such as _IQdiv2(), require a function call to the IQmath library. Make sure you have the IQmath.lib library added to your project.

    Regards,
    David
  • I definitely had the IQmath lib added to my project, but it turned out it was an old version. I changed to the latest (v1.6) and it's ok now.