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. |
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. |