Visit the LQ Articles and Editorials section
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 07-27-2004, 02:59 PM   #1
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

ifdef THAT
#define score 4

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, 03:38 PM   #2
Registered: Jul 2004
Location: Czech Republic - Roudnice nad Labem
Distribution: Debian
Posts: 253

Rep: Reputation: 33
gcc -DTHIS project.c


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 09:22 AM
"--enable-gtk-cairo" in gcc-4.0.2 llmmix Programming 0 11-10-2005 12:38 AM
does anyone know how to enable line completions in vim or gvim Joseph Schiller Linux - Software 2 10-31-2005 10:11 PM
Newbie: how to define cc/gcc path LFCsion Mandriva 3 08-26-2005 04:32 AM
G++ not found, but gcc is there... how to enable/install G++? tzotzo Red Hat 7 08-23-2005 11:37 AM

All times are GMT -5. The time now is 08:18 AM.

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