Linux / C++ - questions about X programming

Message Bookmarked
Bookmark Removed
I've been learning via the GCC compiler a lot about C++ programming recently but most of my results have been through the terminal windows. I want to obtain results through the X environment.

Now the book I got (Tom Swans GCC for Linux) tells me all nice and well how to 'make' the source code into executables but it appears that my version of linux doesn't quite obey the law in terms of what Tom's telling us. He says that I am supposed to compile my programs in something called the C26 folder in the src/ directory but this doesn't exist. Or am I supposed to create it myself?

Also I cannot seem to find the config.mk file he mentions

Nore do I appear to be able to see the xlib.h etc include files anywhere.

Can anyone point me in the right direction, or maybe recommend a better book source? I use SUSE 9.3 if that helps.

Ste (Fuzzy), Monday, 10 October 2005 08:33 (twenty years ago)

> Nore do I appear to be able to see the xlib.h etc include files anywhere.

man updatedb
man locate

8) (isn't xlib.h usually in /usr/include/X11 somewhere? you may need to install the x development package - it's not on my ubuntu box at work)

are you using kde or gnome? (kde is c++ based. gnome is c based) both have extensive tutorials on, and decent tools for, writing applications. try those instead of vanilla X.

config.mk sounds like something configure / automake would use. C26 is unknown to me.

koogs (koogs), Monday, 10 October 2005 09:20 (twenty years ago)

cheers koogs.

I tried looking everywhere for xlib.h, in all the X11 folders that existed. to no avail.

yes i'm using KDE, I will have a gander for the tutorials you speak of. thanks again.

Ste (Fuzzy), Monday, 10 October 2005 09:38 (twenty years ago)

i know gnome and glade better than kde stuff but KDevelop has pretty much everything you need. things written for one or the other will run quite happily under anything as long as people have the runtime libraries installed - i use fluxbox for a desktop but run gnome and kde apps galore.

http://www.kdevelop.org/
http://en.wikipedia.org/wiki/KDevelop
http://women.kde.org/articles/tutorials/kdevelop3/

a bird tells me that xlib.h are part of the xfree86 / xorg development package. don't know what that means in suse though, sorry. oh, 'xdevel' apparently:

rpm -qf /usr/X11R6/include/X11/Xlib.h

koogs (koogs), Monday, 10 October 2005 09:47 (twenty years ago)

funny thing was i had this all working fine with SuSe 7.0, but the upgrade seems to have erased something. I looked on the source disks but there doesn't seem to be anything I've not installed.

ta for the links.

Ste (Fuzzy), Monday, 10 October 2005 09:51 (twenty years ago)

He says that I am supposed to compile my programs in something called the C26 folder in the src/ directory but this doesn't exist. Or am I supposed to create it myself?

My guess is that this is something to do with Chapter 26 of the book maybe?

tissp! (the impossible shortest specia), Monday, 10 October 2005 10:13 (twenty years ago)

Plus, X11 programming is hellish. Run away.

tissp! (the impossible shortest specia), Monday, 10 October 2005 10:14 (twenty years ago)

Yea, god xlib is awful.

Jonothong Williamsmang (ex machina), Monday, 10 October 2005 11:03 (twenty years ago)

tissp! ah ha yes, you might be right (about the book chapter). tho it still doesn't make sense.

anyway just installed every single KDE development item from the SuSe source disks and wow I've opened up some loverly looking development programs for KDE. So will delve into this tonight.

Cheers all

Ste (Fuzzy), Monday, 10 October 2005 11:17 (twenty years ago)

http://www.eclipse.org is all you will ever need.

tissp! (the impossible shortest specia), Monday, 10 October 2005 12:21 (twenty years ago)

Xlib = tool of Satan. Really, don't go there.

RickyT (RickyT), Monday, 10 October 2005 12:28 (twenty years ago)

what's so bad about it?

Ste (Fuzzy), Monday, 10 October 2005 12:31 (twenty years ago)

Its like trying to paint a house with a child's watercolor set

Jonothong Williamsmang (ex machina), Monday, 10 October 2005 12:49 (twenty years ago)

okay I feel a bit dumb for not knowing that the C26 folder was referring to a file on the CD (HE NEVER STATED THIS!!) but everything seems to have fallen into place now and I'm now a bit more knowledable in the world of makefiles. Also having installed every single thing from the suse source disk it would seem that the xlib include files have indeed turned up.

thanks to all, you may now go about your business.

Ste (Fuzzy), Thursday, 13 October 2005 08:19 (twenty years ago)

Yeah I agree... Run away from X programming. Do you have to do it this way? It's really tedious... When I first did it, I used XDesigner, which took some of the hassle out of it; at a different job I didn;t and it was just plain not fun.

Could you just write it in Java (or virtually anything else for that matter)? I realise you might be constrained by what's already there, but it's not a barrel of laughs and dead slow to get anything useful going.

Best of luck anyway.

KeefW (kmw), Thursday, 13 October 2005 17:28 (twenty years ago)

Well yeah I'm still only a beginner with linux and just finding my way around a little.

I suppose I want knowledge in more than one area so I can choose best programming paths for certain tasks. I may never use X programming at all but I'd like to at least be able to say I've looked into it.

If I had the time I'd be programming everything in Assembly!

Anyway in response to some of the posts here I just bought a new book on KDE and QT development. Wish me luck, oh you just did.

Ste (Fuzzy), Thursday, 13 October 2005 21:31 (twenty years ago)

one year passes...

Okay, who here knows about gtk/wxPython/gui filehandling?

kingfish, Monday, 25 June 2007 18:13 (eighteen years ago)

can someone here tell me how to do my job because I don't know how

Curt1s Stephens, Monday, 25 June 2007 18:15 (eighteen years ago)

gtk is awful

Catsupppppppppppppp dude 茄蕃, Monday, 25 June 2007 18:29 (eighteen years ago)

jw is a diss bot for all things that aren't the OS X Finder

El Tomboto, Monday, 25 June 2007 18:33 (eighteen years ago)

Movable Type sux

-- Catsupppppppppppppp dude 茄蕃, Wednesday, June 6, 2007 5:13 PM

El Tomboto, Monday, 25 June 2007 18:34 (eighteen years ago)

gtk is the only thing that'll run the gui bits that i need.

kingfish, Monday, 25 June 2007 18:37 (eighteen years ago)

What are you having trouble with? GTK doesn't really have much to do with filehandling itself.

Forest Pines Mk2, Tuesday, 26 June 2007 08:32 (eighteen years ago)

yeah, i thought that. but maybe he meant

http://www.pygtk.org/docs/pygtk/class-gtkfileselection.html

ie the file selector dialog box thing.

koogs, Tuesday, 26 June 2007 09:46 (eighteen years ago)

Mmmm. I have used it, briefly - in C rather than in Python, though.

Forest Pines Mk2, Tuesday, 26 June 2007 10:10 (eighteen years ago)

yeah, me too. loved the whole 'define the entire gui in xml' aspect of it. didn't use it for much more than writing my own version of knotes / gnome-notes though.

but, apparently, it's awful, so i won't bother again.

koogs, Tuesday, 26 June 2007 10:27 (eighteen years ago)

I haven't tried Glade - I just code it all up the old-fashioned way.

Forest Pines Mk2, Tuesday, 26 June 2007 10:28 (eighteen years ago)

Is cool. Finally got the thing working. Was having problems setting the directory & filename in the dialog box.

kingfish, Tuesday, 26 June 2007 14:26 (eighteen years ago)


You must be logged in to post. Please either login here, or if you are not registered, you may register here.