Error Macro Names Must Be Identifiers Arduino
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more error macro names must be identifiers c++ about Stack Overflow the company Business Learn more about hiring developers or posting ads error macro names must be identifiers linux with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack command-line error macro names must be identifiers Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Error: macro names must be identifiers using #ifdef 0 up vote 24
Command Line 0 1 Error Macro Names Must Be Identifiers
down vote favorite 6 I have the source code of an application written in C++ and I just want to comment something using: #ifdef 0 ... #endif And I get this error error: macro names must be identifiers Why is this happening? c++ macros c-preprocessor share|improve this question edited Nov 27 '15 at 11:33 Brian Tompsett - 汤莱恩 3,093132775 asked Jan 9 '09 at 1:27 Eduardo 4,220164567 macro names must be identifiers c I think you misremembered; #ifdef 0 is an error in C as well as C++. –Jonathan Leffler Jan 9 '09 at 2:25 2 You are right I misrembered, It does not work in C, I am not going to delete the question because maybe someone in the future makes the same mistake. –Eduardo Jan 9 '09 at 5:36 @Eduardo Thanks for not deleting the question. –kartik Feb 24 '14 at 8:00 add a comment| 6 Answers 6 active oldest votes up vote 47 down vote accepted The #ifdef directive is used to check if a preprocessor symbol is defined. The standard (C11 6.4.2 Identifiers) mandates that identifiers must not start with a digit: identifier: identifier-nondigit identifier identifier-nondigit identifier digit identifier-nondigit: nondigit universal-character-name other implementation-defined characters> nondigit: one of _ a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z digit: one of 0 1 2 3 4 5 6 7 8 9 The correct form for using the pre-processor
All CPLDs » Configuration
#ifdef 0 In C
Program Storage Power PowerSoC Converters DDR Memory Termination All Devices » Intellectual Property What's New in http://stackoverflow.com/questions/426736/error-macro-names-must-be-identifiers-using-ifdef-0 IP Best in Class IP Nios II Processor Find IP Reference Designs Boards & Kits Development Kits Daughter Cards Cables & Adapters SoC System-on-Modules Design Software What's New Quartus Prime Software Altera SDK https://www.altera.com/support/support-resources/knowledge-base/solutions/rd11172011_386.html for OpenCL DSP Builder SoC Development Tools SoC EDS ARM DS-5 AE All Products Industry Solutions Automotive Broadcast Computer & Storage Consumer Industrial Medical Military, Aerospace & Gov Test & Measurement Wireless Wireline Technology Heterogeneous Integration Machine Learning Digital Signal Processing External Memory Security Transceivers Intelligent Vision & Video Internet of Things Partners Design Solutions Network COTS Board Partners EDA Partners End Market Partners Mathworks Partnership OpenCL Partners SoC Partners Training Partners System Design Journal Help and solutions for tomorrow's design.by Ron Wilson,Editor-in-Chief Design Solutions New to FPGAs Product Selector Design Store All Solutions
Visited Search Results View More Blog Recent Blog Posts View More PMs Unread PMs Inbox Send New PM View More http://www.microchip.com/forums/m458421.aspx Page Extras Menu Forum Themes Elegant Mobile Home » All Forums https://github.com/DynamicPerception/ArduinoAT90USB/issues/1 » [32-Bit Microcontrollers] » General PIC32 Topics » macro names must be identifiers Mark Thread UnreadFlat Reading Mode❐ Lockedmacro names must be identifiers Author Post Essentials Only Full Version spirit Starting Member Total Posts : 75 Reward points : 0 Joined: 2008/09/07 13:01:43Location: Hungary Status: must be offline 2009/11/13 15:48:33 (permalink) 0 macro names must be identifiers Hello everybody! I just right now purchased a new DELL notebook, and has installed the MPLAB, and c32 compiler, I just would compile a project, and I get the following messages: ..\Microchip\Graphics\Primitive.c:1551:8: macro names must be identifiers ..\Microchip\Graphics\Primitive.c:1556:8: macro names must be identifiers ..\Microchip\Graphics\Primitive.c:1561:8: macro names must macro names must be identifiers ..\Microchip\Graphics\Primitive.c:1972:8: macro names must be identifiers ..\Microchip\Graphics\Primitive.c:2054:8: macro names must be identifiers ..\Microchip\Graphics\Primitive.c:2123:8: macro names must be identifiers - small codepiece from the "Primitive.c" : #ifdef (COLOR_DEPTH >= 4) //------------------------------- this is the line 1551 case 4: PutImage4BPPExt(left, top, bitmap, stretch); break; #endif #ifdef (COLOR_DEPTH >= 8) case 8: PutImage8BPPExt(left, top, bitmap, stretch); break; #endif #ifdef (COLOR_DEPTH == 16) case 16: PutImage16BPPExt(left, top, bitmap, stretch); break; #endif default: break; ... etc what can be missing ? This code was compiled well on the other PC. Everything is new install. Thanks for any hint. Peter #1 2 Replies Related Threads JasonK Super Member Total Posts : 3341 Reward points : 0 Joined: 2003/11/14 09:49:40Location: Microchip Technology in Arizona, USA Status: offline RE: macro names must be identifiers 2009/11/13 17:07:00 (permalink) 0 #ifdef (COLOR_DEPTH >= 4) Did that come straight from the most recent version of the graphics library? Try #if (COLOR_DEPTH >= 4) instead. Jason Kaj
Sign in Pricing Blog Support Search GitHub This repository Watch 9 Star 9 Fork 8 DynamicPerception/ArduinoAT90USB Code Issues 1 Pull requests 0 Projects 0 Pulse Graphs New issue Error with 1287/1286 on Arduino IDE 1.0.5 #1 Closed KirAsh4 opened this Issue Jun 12, 2013 · 6 comments Projects None yet Labels bug Milestone No milestone Assignees thisdroneeatspeople 2 participants KirAsh4 commented Jun 12, 2013 I posted this on the Arduino forum as well. I grabbed the source from about 3 days ago and installed it. Made the necessary changes to the various files and all (this isn't my first rodeo with cores that don't come with the IDE.) I opened the IDE, selected the 'AT90USB1287 16MHz' board, opened the blink sketch and tried compiling it and was presented with a lovely error instead: In file included from C:\Program Files (x86)\arduino-1.0.5\hardware\arduino\cores\AT90USB/LUFA/usb_cdc_hid.h:40, from C:\Program Files (x86)\arduino-1.0.5\hardware\arduino\cores\AT90USB/usb_api.h:37, from C:\Program Files (x86)\arduino-1.0.5\hardware\arduino\cores\AT90USB/Arduino.h:184, from sketch_jun09b.ino:1: C:\Program Files (x86)\arduino-1.0.5\hardware\arduino\cores\AT90USB/LUFA/Board.h:143:2: error: #error unsupported board Selecting the '1287 USBKey 16MHz' board gave the same error, but selecting the 646, it compiles without as much as a burp. Something's up ... thisdroneeatspeople commented Jun 12, 2013 Let me check on it, and see what's up - I just made a ton of changes over the past week, focusing primarily on 1.5.x, and may have accidentally replaced that file in 1.0.x. thisdroneeatspeople was assigned Jun 12, 2013 thisdroneeatspeople added a commit that referenced this issue Jun 12, 2013 thisdroneeatspeople a079d70 thisdroneeatspeople commented Jun 12, 2013 Issue fixed by a079d70 KirAsh4 commented Jun 13, 2013 Using 1.5.2, with a fresh downloaded archive from github, and attempting to compile the Blink sketch on the 1287 board, I get this: C:\Program Files (x86)\arduino-1.5.2\hardware\tools\avr\bin\avr-g++ -c -g -Os -fno-ex
… * Fixing #1 - board checks got removed from LUFA/Boards.h