LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Compiling programmes: How to use #ifdef? (https://www.linuxquestions.org/questions/linux-general-1/compiling-programmes-how-to-use-ifdef-265983/)

asciimonster 12-13-2004 01:26 PM

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.

acid_kewpie 12-13-2004 01:35 PM

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.


All times are GMT -5. The time now is 05:17 PM.