LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   syntax error with XSetWindowAttributes help (https://www.linuxquestions.org/questions/programming-9/syntax-error-with-xsetwindowattributes-help-208805/)

SciYro 07-23-2004 01:29 PM

syntax error with XSetWindowAttributes help
 
hello, I'm trying to get a small program i made in c to compile (right now even the code looks like a house built with cardboard and thumbtacks by a blind man)

anyways when i try to compile i keep getting this error
Code:

prog.c:14: error: syntax error before '->' token
anyways, heres lines 12 to 19 :
Code:

XSetWindowAttributes *pwmatt;

pwmatt->background_pixmap = ParentRelative;
pwmatt->background_pixel = ParentRelative;
pwmatt->border_pixel = BlackPixel(display, screennum);
pwmatt->win_gravity = NorthWestGravity;
pwmatt->override_redirect = true;
pwmatt->event_mask = ButtonPress|ButtonRelease;

line 14 is the first "pwmatt->" part, i can move that line with any of the lines below it and it still says its on line 14.. so I'm guessing theres something wrong with all of them

i replace the "->" with "." and it says the error is with the "." token instead

any help? i feel like i tried everything but no luck

SciYro 07-23-2004 07:06 PM

never mind, apparently it was just being fussy because it was feeling left out of the main function were most of the action was taking place (tho i don't know what kinda of action was going on..)

anyways, .. now its a problem with "ld" it keeps exiting with error status 1

all i know is it says it cant find "-lX11" ... i use gentoo with trusted path execution (does this make a difference?) is there some special trick to get it to compile?

i use
Code:

gcc prog.c -o prog -lX11
as the compile command

gizmo_thunder 07-24-2004 03:58 AM

check this out
http://xander.ncl.ac.uk/game/index1.php

SciYro 07-24-2004 02:03 PM

thanks, i got the program to compile now by following a makefile i found in that link... now to get past the "segmentation fault" .. owell... time to get a debug program, some more tea, and maybe a fan :)

thanks again gizmo_thunder


All times are GMT -5. The time now is 12:25 AM.