Hi, I need to have my compiler take preprocessor definitions from the
command line. How does it differ from normal command line parameter passing (main(int arc, char *argv[])) ?
Thanks.
ejptccs123
0
Newbie Poster
Recommended Answers
Jump to PostIt depends on the compiler; you'll usually see things like -D<symbol> or \D<symbol>. Look it up in your documentation.
Jump to Post1. g++ -DHAVE_CONFIG -Wall -std=c++98 -o myprogram
2. ,/myprogram hello worldin 1., the command line args are used by the c preprocessor, some are forwarded to the compiler and linker
in 2., the command line args are passed to myprogram and are available as parameters passed to …
All 5 Replies
Narue
5,707
Bad Cop
Team Colleague
ejptccs123
0
Newbie Poster
paramaguru
-2
Newbie Poster
Bench
commented:
Digging up a thread from 3 years ago
+0
WolfPack
commented:
Rude
-2
vijayan121
1,152
Posting Virtuoso
thekashyap
193
Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.