fdmlib with CWv5.7

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

fdmlib with CWv5.7

698 Views
cbhavi
Contributor III

Hello,

 

I am working with CodeWarrior v5.7.0, Build 2264 for Coldfire processor MCF512x.

 

My problem is that, I am not able to use the "fdlibm.h" file in any project with this version of codewarrior.

 

I get errors like,

Error  : ';' expected

fdlibm.h line 43 extern _INT32 signgam; /*- cc 020130 -*/

Error  : ';' expected

fdlibm.h line 94 extern _INT32 matherr __P((struct exception *)); /*- cc 020130 -*/

and etc etc.. about 17 similar errors.

 

What I have come to understand is that the compiler is unable to identify the definition "_INT32".
This has been defined in "msl_t.h" as typedef _MSL_INT32_TYPE _INT32; .
And _MSL_INT32_TYPE has been defined as #define _MSL_INT32_TYPE int in "ansi_prefix.E68k.h".
Since all definitions are correctly present, why do these errors then occur?
Maybe I have missed out on some key points for using the MSL.
Please help.
-Bhavya
Labels (1)
0 Kudos
3 Replies

458 Views
J2MEJediMaster
Specialist I

The fact that the compiler is griping about a semicolons is a hint that some macro or other symbol definition is missing. There might be another header file you need to include. I would look at the output of the preprocessor to get a better idea of where things are going wrong.

 

---Tom

0 Kudos

458 Views
cbhavi
Contributor III

Hello,

 

Thank you.

I did what you suggested, and i found that the header 'cmath' is unable to access 'math_api.h'.

 

The include for math_api.h is under the conditional statement in the file cmath

#if _MSL_FLOATING_POINT && !defined(_MSL_NO_MATH_LIB)
  blah blah
  blah blah
  etc etc
 
  #include <math_api.h> 

  etc etc

#endif

 

The defintions for the above macros are provided in 'ansi_prefix.CF.size.h' as below,

#if !(__COLDFIRE__ == 0x4080 && !__option(fp_library))
#define _MSL_FLOATING_POINT   0
#define _MSL_NO_MATH_LIB                1
#endif

 

I tried defining '_MSL_FLOATING_POINT'  to 1 and '_MSL_NO_MATH_LIB' as '0' and rebuilt the C-library.

Still, no effect.

 

The only thing that seems to work is to place the include statement for 'math_api.h' outside the #if statement in the file 'cmath', but that doesnt seem like a good thing to do.

Any suggestions?

 

-Bhavya

 

0 Kudos

458 Views
J2MEJediMaster
Specialist I

If memory serves, the Targeting ColdFire manual, located in the Help folder of the CodeWarrior installation folder, has information on how to build the libraries with different features, such as with/without floating point support, and with/without console I/O.

 

---Tom

0 Kudos