Tuesday, October 06, 2009

How can i use linux low level/posix api with #qt ?

well i was searching the google about the above question and i remembered that you can use c api in c++ like any other function

you can see these posix linux threads examples that can be compiled with c++ like this $ g++ -lpthread pthread1.c


Next step was to create a simple example with qt creator 
something like get_pid.c example from advanced linux programming book 


so after an empty gui project is created do small modification like this and run it 


it should give you no errors and it should print in the console the pid 



Starting /home/mariuz/work/qtgetpid/qtgetpid/qtgetpid...
/proc/self reports process id 7977
getpid() reports process id 7977












No comments: