LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 12-13-2004, 02:26 PM   #1
asciimonster
LQ Newbie
 
Registered: Mar 2004
Posts: 20

Rep: Reputation: 0
Compiling programmes: How to use #ifdef?


I currently have a basic idea how linux works and how to compile and install a programme. Sometimes, the compiler gives an error on a command like this:

#ifdef SCHED_NORMAL
set_user_nice(current, -10);
#else
current->nice = -10;
#endif

Clearly the guy who wrote this had this problem (in this case a different kind of semantics) in mind and added it through compiler directives (N.B. this is really where my c++ knowledge ends). It acts as a switch, if you will. How do I set SCHED_NORMAL to true so that it compiles correctly? I tried looking in the Makefile, but I couldn't find it.
 
Old 12-13-2004, 02:35 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967Reputation: 1967
you'd need to compile it with -DSCHED_NORMAL in the gcc command. normally there is a cpp_flags variable in the makefile, or something along those lines.
 
  


Reply


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
removing programmes (games) master Red Hat 2 07-06-2005 04:12 PM
ifdef for suse?? nkshirsagar Suse/Novell 2 01-11-2005 12:12 AM
help with #ifdef #undef etc tuxfood Programming 3 06-29-2004 09:12 AM
Deleting unwanted programmes... Ewen Linux - General 33 12-27-2002 12:17 AM
x86 programmes for LinuxPPC2000 Slippy Linux - Newbie 5 11-01-2000 11:26 AM


All times are GMT -5. The time now is 12:56 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration