Home > other >  Linux - GCC: - pthread: no such file or directory
Linux - GCC: - pthread: no such file or directory

Time:01-05

I have tried to compile the code below in the terminal
GCC: - pthread: no such file or directory,
What this error means and how to eliminate it?
File name: window.
cCode:

# include & lt; The GTK/GTK. H>

Int main (int arg c, char * argv []) {

GtkWidget * window;

To gtk_init (& amp; Arg c, & amp; Argv);

The window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
Gtk_widget_show (Windows);

Gtk_main ();
return 0;

}

I try to compile it with the following parameters: -

GCC - Wall - g window. C - o window ` PKG - config -- cflags GTK + 2.0 ` ` PKG - config - libs GTK + 2.0 `

CodePudding user response:

This is likely to mean that your system is not installed development part of threading library. You can use the following command to find the platform - pthread marks:
GCC - dumpspecs | grep "% {pthread
"I've learned:

% % {posix: - D_POSIX_SOURCE} {pthread: - D_REENTRANT}
% {pthread: - lpthread} {{} Shared: - lc % %! Shared: % {mieee - fp: - lieee} {{profile: - lc_p} % %! Profile: - lc}}

This means that my system - pthread added - D_REENTRANT and - lpthread. So missing files will be libpthreads. Sometihing.

CodePudding user response:

Want to ask you to solve this problem
  • Related