I have written a program in C using GTK3 version 3.24 on a Raspberry Pi. There are several buttons in the application.
When I click one particular button, I want to launch a thread that will output a number of pulses on a pin of the Raspberry Pi. It shall be possible to stop the outputting of pulses by clicking another button at any time. I use pigpio for control of the pin. Hence I have an 'on_execute_clicked' button function to launch a pthread, but the compilation fails with the message:
/usr/bin/ld: main.o: undefined reference to symbol 'pthread_create@@GLIBC_2.4'
I have the statement #include <pthread.h> in my source file.
What am I doing wrong?
Is it not possible to use pthread in a GTK3 program?
How may I get a "function" to execute in the background?
Regards, Jorgen
PS. the g_thread is not available in GTK3 version 3.24