Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6793

Error encountered after running 'make' despite finding 'stdio.h' in /usr/include

$
0
0

I've encountered a perplexing issue while compiling a program. Despite having the stdio.h file in /usr/include and compiling with the gcc command without errors, I still encounter the following error when executing the make command:fatal error: stdio.h: No such file or directoryI've already executedsudo apt-get install libc6-devso I'm puzzled as to why this error persists. Any insights or suggestions would be greatly appreciated. Thank you!

program:

#include <stdio.h>#include <X11/Xlib.h>#include <X11/Xutil.h>int main() {    Display *display;    Window root_window;    XEvent event;    // Open display connection    display = XOpenDisplay(NULL);    if (display == NULL) {        fprintf(stderr, "Unable to open display connection\n");        return 1;    }    // Get the root window    root_window = XRootWindow(display, DefaultScreen(display));    // Listen for mouse button events    XGrabButton(display, AnyButton, AnyModifier, root_window, True,                ButtonPressMask | ButtonReleaseMask, GrabModeSync, GrabModeAsync,                None, None);    printf("Intercepting mouse events...\n");    // Enter event loop    while (1) {        XNextEvent(display, &event);        if (event.type == ButtonPress) {            printf("Mouse button press event intercepted\n");            // Add your handling logic here        } else if (event.type == ButtonRelease) {            printf("Mouse button release event intercepted\n");            // Add your handling logic here        }    }    // Close display connection    XCloseDisplay(display);    return 0;}

Makefile:

obj-m += program2.oall:    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules EXTRA_LDFLAGS="-L/usr/lib -lX11"clean:    make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean

enter image description here

I hope to run the 'make' command without encountering any errors.


Viewing all articles
Browse latest Browse all 6793

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>