This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Keil5 cant locate rtl.h, but generates hex file

After getting the new keil5 MDK, i compiled the code developed in keil4. (the legacy package has to be installed to achieve the reverse-compatibility).

everything seems to be working fine, except two change:

#define MHZ             *10000001

#define SYS_FREQ 60 MHZ

#if   SYS_FREQ == (120 MHZ)
        #define SDRAM_PERIOD          8.33  // 96MHz
#elif     SYS_FREQ == (96 MHZ)
        #define SDRAM_PERIOD          10.4  // 96MHz
#elif   SYS_FREQ == (72 MHZ)
        #define SDRAM_PERIOD          13.8  // 72MHz
#elif   SYS_FREQ == (60 MHZ)
        #define SDRAM_PERIOD          16.67  // 72MHz
#elif   SYS_FREQ == (57 MHZ)
        #define SDRAM_PERIOD          17.4  // 57.6MHz
#elif SYS_FREQ == (48 MHZ)
        #define SDRAM_PERIOD          20.8  // 48MHz
#elif SYS_FREQ == (36 MHZ)
        #define SDRAM_PERIOD          27.8  // 36MHz
#elif SYS_FREQ == (24 MHZ)
        #define SDRAM_PERIOD          41.7  // 24MHz
#elif SYS_FREQ == (12 MHZ)
        #define SDRAM_PERIOD          83.3  // 12MHz
#else
        #error Frequency not defined
#endif

//The MHZ (in sdram.h) has to be separated by a white space from the number value,
// unlike in keil4 where the white space was not necessary. 



#include <rtl.h>    // Marks a red cross adjacent to this line in the FileConfig.h only (which is the new way of keil to highlight the warnings and error)
// the error reads : RTL.H File not found with <angled> include; use "quotes" instead

not sure why this error is shown only in the 'file_config.h'. In all the other .c source files, this error is not displayed. also the project is build and i can download and debug the code (though i have not single stepped through whole code, but think that it may not be an issue of much concern)

Parents
  • Does the first case indicate a bug in gcc?

    No. It indicates that it's allowed to define a macro to expand to nonsense, as long as you never refer to that macro. If the macro is never expanded, the expansion will never make it past that definition, so it doesn't matter what's in there.

    In the case at hand "210MHZ" is a valid preprocessing token, but it cannot be converted into a non-preprocessing token. So every time the compiler tries to use it beyond the mere text-replacement aspects of the preprocessing phase, that's an error.

Reply
  • Does the first case indicate a bug in gcc?

    No. It indicates that it's allowed to define a macro to expand to nonsense, as long as you never refer to that macro. If the macro is never expanded, the expansion will never make it past that definition, so it doesn't matter what's in there.

    In the case at hand "210MHZ" is a valid preprocessing token, but it cannot be converted into a non-preprocessing token. So every time the compiler tries to use it beyond the mere text-replacement aspects of the preprocessing phase, that's an error.

Children