473,388 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

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
1 2565
Banfa
9,065 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

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

Similar topics

1
by: Cronus | last post by:
Hi the following code the g++ (g++ (GCC) 3.3.3 (Debian 20040422)) emits the error message that pasting of :: and hello is no valid preprocessor token. The g++ 2.95.3 accepts the code. I know...
12
by: Francois Grieu | last post by:
Can #include safely use a preprocessing token, as in #define HEADERFILE "stdio.h" #include HEADERFILE int main(void) {return printf("Hello, world\n")*0;} TIA, François Grieu
3
by: Frodo Baggins | last post by:
Hi All, I have a piece of code (not written by me) that is failing on compile with the error: pasting "xdr_ndmp_connect_open_request" and "," does not give a valid preprocessing token The...
5
by: Chris | last post by:
Hi all We have a strange problem with macros: #define SQLST_MAP_IND_O(Tbl,Fld) i##Tbl##_O=i##Tbl##_##Fld; SQLST_MAP_IND_I(RAGREEJ1,FORMFROMTMSTP); => gcc 3.3.4 gives the following error:...
4
by: unifire | last post by:
Hi I use a define like this to search an element in a linked list #define SEARCH_NEXT( _Block, _Queue) { _Block = _Block->##_Queue.pNext; }
7
by: Mark Odell | last post by:
I'm running two different compilers against some hairy macros and one, gcc, doesn't like my token pasting result so much. It says, " "." and "foo" does not give a valid preprocessing token ". Some...
5
by: Takeadoe | last post by:
Gang - I'm generating date and time variables from scanned forms. Currently, the date and time values are as follows: 06/26/2006 and 11:30 AM. I've written VBA code to combine them into a...
2
by: mark.bergman | last post by:
I am porting some old code from Digital Unix to Linux using token pasting, which is failing to compile (code simplified): #define DEBUG(strg,v) printf("debugoutput: "##strg##".\n", v); main()...
1
by: jeff | last post by:
Given: ===Program <=== $ cat macro_delay_expansion.c #define args(a,b) a, b #define myprintf(a, b, c) do { \ printf("%d %d %d\n", a, b, c );\ } while(0)
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.