LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-27-2004, 01:59 PM   #1
newguy21
LQ Newbie
 
Registered: Jul 2004
Posts: 8

Rep: Reputation: 0
HOW TO enable a #define in .h from gcc line??


Hi, Thanks to All in advance. I am relatively new to Linux and had a question for you all. If I have numerous #ifdef's in my header file and wanted to use one of them with a #define, can I do this when making the project or when compiling so that that definiton is enabled? and the others won't work. for example,

#ifdef THIS
#define score 3
#endif

ifdef THAT
#define score 4
#endif

now say I wanted score = 3 and instead of putting the #define THIS at the top of the header, I'd like to activate it from the command line when compiling the file. is this possible?? if not, does anybody have any easy solutions? Thank you so much and I hope I didnt confuse anyone too badly.
 
Old 07-27-2004, 02:38 PM   #2
Vookimedlo
Member
 
Registered: Jul 2004
Location: Czech Republic - Roudnice nad Labem
Distribution: Debian
Posts: 253

Rep: Reputation: 34
gcc -DTHIS project.c
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ text file line by line/each line to string/array Dimitris Programming 15 03-11-2008 08:22 AM
"--enable-gtk-cairo" in gcc-4.0.2 llmmix Programming 0 11-09-2005 11:38 PM
does anyone know how to enable line completions in vim or gvim Joseph Schiller Linux - Software 2 10-31-2005 09:11 PM
Newbie: how to define cc/gcc path LFCsion Mandriva 3 08-26-2005 03:32 AM
G++ not found, but gcc is there... how to enable/install G++? tzotzo Red Hat 7 08-23-2005 10:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration