467,911 Members | 1,430 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,911 developers. It's quick & easy.

does not give a valid preprocessing token

Expand|Select|Wrap|Line Numbers
  1. #define PROJECT_ID ram
  2.  
  3. #define QUOTES(FILENAME)  #FILENAME
  4. #define DATA_VAR_FILENAME(PROJECT_ID) QUOTES(../##PROJECT_ID##_data_var.h)
  5. #define DATA_VAR_FILE(PROJECT_ID) DATA_VAR_FILENAME(PROJECT_ID)
  6. #define CUST_DATA_VAR_FILENAME DATA_VAR_FILE(PROJECT_ID)
when I tried to include CUST_DATA_VAR_FILENAME like below
#include CUST_DATA_VAR_FILENAME

Will get below error
error: pasting "/" and "ram" does not give a valid preprocessing token
May 2 '14 #1
  • viewed: 1780
Share:
1 Reply
Banfa
Expert Mod 8TB
. and / are both token separators this means that you do not need to concatenate them onto anything, this should work
Expand|Select|Wrap|Line Numbers
  1. #define DATA_VAR_FILENAME(PROJECT_ID) QUOTES(../PROJECT_ID##_data_var.h)
May 2 '14 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by Francois Grieu | last post: by
3 posts views Thread by Frodo Baggins | last post: by
5 posts views Thread by Chris | last post: by
4 posts views Thread by unifire | last post: by
7 posts views Thread by Mark Odell | last post: by
2 posts views Thread by mark.bergman | last post: by
1 post views Thread by jeff | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.