Restoring the /usr/include directory after screwing it up

Real developers may get a laugh out of this one, although to me it is not funny. I have been trying to create a GUI in Python and/or C using GTK 3.0 and Glade.

Most of my programming career has been about the CLI, writing background programs and such

I watched the first episode of the link
Creating GUI With Glade
I have only begun to explore the world of GTK+ with Python. The video presenter wrote his controlling program in C. No matter, I program in C too.

The compile.script that the presenter (Kevin O’Kane) invoked gcc in a way I hgad not seen before. This is at the end of the first episode.

Well the compile failed, and upon examination I could see that the compiler was looking for directories suck as /usr/include/gtk. My up-to-date (until recently) Fedora 33 box had a rich variety of include file and directories, but the were versioned. For example, the compile script failed because it couldn’t find, for example #include <gtk./gtk.h>. I looked inside /usr/directory and saw that there were various versions, starting with /usr/include/gtk-3.0, /usr/include/glib-2.0. These had the common directories as I had expected. I don’t know how #include <gtk/gtk.h> resolves to /usr/include/gtk-3.0/gtk/gtk.h,

As I used ‘locate’ to search for the 'missing include files, I saw that the script was looking for (e.g.) <gdk/gdk.h>. That file was formally located at /usr/include/gtk-3.0/gdk/gdk.h>.

So I tried a number of things, such as creating syml;inks from the file being sought, and it’s actual location.

Do not throw tomatoes. I grew up programming C and Assembler in the old days, and I did not program in Unix, except for one project.

I am going to include the “compile.script” because it is one of the stranger items I have seen. Possibly not to you Unix-heads.

Meanwhile, my /usr/include directory is a shambles. Is there any way to restore it to its previous state?

Any advice would help.

I know I did a number of things one shouldn’t do, but I was desperate.

Contents of compile.script:
#!/bin/bash
gcc -Wno-format -o part1.bin part1.c -Wno-deprecated-declarations -Wno-format-security -lm package-config --cflags --libs gtk+-3.0 -export-dynamic

Yes I’m only a would-be developer, but I really would like to learn systems, or eve Glade programming, as well as C/C++/Python/etc.
Constructive comments welcome.

BryGuy

1 Like

The compile.script should have a backtick before `package-config, as well as one after gtk+3.0.

So, I’d start with getting your system back in shape. Did you just create symlinks, or did you delete and move things?

I also have a recommendation: this classic book to help get oriented:

sudo rpm -V -a | grep -e /usr/include

I didn’t delete anything, but I create directories, such that the program asked for, e.g., #include <gtk/gtkx.h>, ansd the message told me it couldn’t find the directory “”, I actually created a directory /usr/include/gtk, and put the contents of /usr/include/gtk-3.0/gdk into it.

I have done stupider things, but this is one of my real beauts.