incbin icon indicating copy to clipboard operation
incbin copied to clipboard

incbin doesn't work in arm compiler 5 (armcc)

Open GorgonMeducer opened this issue 2 years ago • 2 comments

When I test the incbin in arm compiler 5 with the following code:

#define INCBIN_PREFIX
#define INCBIN_STYLE INCBIN_STYLE_SNAKE
#include "incbin.h"


INCBIN(HOTEL_MP3_ROM, "hotel.mp3");

I get following error message:

error:  #412: an "asm" declaration is not allowed here
  INCBIN(HOTEL_MP3_ROM, "hotel.mp3");

The arm compiler 5 version is V5.06 update 7 (build 960).

Please help.

By the way, the official method to detect arm compiler 5 and arm compiler 6 is as following:

// for arm compiler 5
#undef __IS_COMPILER_ARM_COMPILER_5__
#if ((__ARMCC_VERSION >= 5000000) && (__ARMCC_VERSION < 6000000))
#   define __IS_COMPILER_ARM_COMPILER_5__       1
#endif


//for arm compiler 6

#undef __IS_COMPILER_ARM_COMPILER_6__
#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
#   define __IS_COMPILER_ARM_COMPILER_6__       1
#endif

I hope this helps.

GorgonMeducer avatar Mar 16 '23 22:03 GorgonMeducer

I got same ERROR #412 at MDK 5.39. I am new to this area , assming there are directive [INCBIN]((https://developer.arm.com/documentation/dui0801/l/Directives-Reference/INCBIN) in ARM asm languge. Naturely,Arm compiler 5 recoginze it as asm . BY THE WAY ,I use this method ARM: Include a Binary Image into an Application achieve including a binary image into firmwork. I will continue to investigate this problem.

qiaorunpu avatar Oct 23 '24 07:10 qiaorunpu

Need more information

graphitemaster avatar May 26 '25 23:05 graphitemaster